Skip to main content
The Loop runtime is an opt-in ECS Fargate service that runs Loop threads in your own data plane, using isolated AWS Lambda MicroVM sandboxes for command execution and investigation tasks. It is disabled by default, so Loop, the Debugger, and Patterns are unavailable until you enable it.
This page applies to AWS deployments using Terraform module v6.5.2 or later. The Loop runtime is not available on GCP or Azure.

What the runtime provides

Loop does its investigation work in a sandbox, an isolated environment where it reads, searches, and lists trace files directly and runs commands against your data. That is what lets it work through a trace too large to read in one pass, and keep going on a long investigation instead of being bound to a browser session. Threads persist, so users can leave and resume them. The Loop runtime and its isolated sandboxes also support the Debugger, which investigates individual traces, and Loop automations, which perform recurring work on a schedule. Patterns runs as a scheduled Loop automation, so it requires the runtime too. See What Loop can do for the full range. On Braintrust-hosted deployments, Braintrust provides the sandbox. Self-hosted deployments provide it themselves by enabling this service.

Enable the runtime

Set two variables in your data plane module and apply. One deploys the ECS service and its sandbox, and the other decides whether those sandboxes can reach the network.
enable_loop_runtime deploys the ECS service and its MicroVM sandbox. It is false by default. It doesn’t depend on enable_ecs_api, which controls only whether CloudFront routes API traffic to ECS. The runtime works either way, because its URL reaches both the ECS API tasks and the Lambda API handlers. loop_runtime_sandbox_egress_mode controls whether sandbox MicroVMs can reach the network. Braintrust recommends "restricted", which is the module default and how Braintrust runs its own deployment.
  • "restricted": The module creates a dedicated VPC for sandboxes, with a security group that has no egress rules and a Route 53 Resolver DNS firewall that blocks every domain. Sandboxes have no outbound network access and can’t resolve names. Two constraints come with it: the VPC uses the 10.255.0.0/16 CIDR block, which you can’t configure, and you can’t supply an existing VPC for it, including your quarantine VPC, which has no DNS firewall.
  • "internet": Sandboxes use an AWS-managed internet egress connector and can reach the public internet.
Any value other than exactly "internet" is treated as restricted. On module v6.7.0 and later, the default is "restricted". Modules v6.6.0 and earlier default to "internet", so set the variable explicitly before upgrading if your sandboxes need outbound internet access. On module v6.5.2 and later, the runtime sends Loop’s LLM calls through your deployment’s own AI proxy. Earlier versions routed them to gateway.braintrust.dev once enable_ecs_api was set. Upgrade to v6.5.2 or later before enabling the runtime if your deployment must keep inference traffic inside your network. See Braintrust Gateway.
The Loop runtime image isn’t pinned to the module version. The module tracks the latest 2.x release, so a new runtime image can roll out to your deployment without a Terraform change. Set loop_runtime_version_override to pin an exact tag.

Enable Patterns

Applying the runtime makes Loop and the Debugger available across your organization, but it doesn’t start Patterns. Each project turns Patterns on separately, and the person who does it needs permission to create project automations. See Enable Patterns.

Telemetry

On module v6.7.0 and later, the Loop runtime sends metrics and traces for its own service to Braintrust’s control plane, in addition to whatever telemetry types your deployment configures. Braintrust uses them to diagnose runtime problems while the service stabilizes, and you can’t turn them off while the runtime is enabled. These traces describe the runtime’s operation and can include model and tool identifiers, timing information, and errors. If your deployment can’t send this telemetry, leave the Loop runtime disabled and contact Braintrust.

Configuration reference

On module v6.8.1 and later, the runtime serves the organization named by braintrust_org_name. Earlier versions used a separate loop_runtime_org_name variable. Remove it from your configuration before you upgrade, or the plan fails with An argument named "loop_runtime_org_name" is not expected here.

Next steps