Skip to main content

Architecture

This page shows what is deployed for auto_swe and how a work item moves through it. Each section links to the page with the details.

What is deployed​

GitHub App and the webhook function​

The GitHub App sends each event to the auto-swe-github-webhook function's URL. The function checks the delivery's signature and reduces the delivery to a work item. It then starts or signals the session for the work item's subject. It responds with 202, or with 200 for a delivery it drops. How a session runs lists the events, and Security model describes the signature check.

Session workflow​

Temporal Cloud runs one session per subject, such as one pull request, in the auto-swe.obsii namespace. For each agent with a trigger that a work item matches, the session starts an agent run and runs its steps, one agent run at a time. How a session runs describes the session. Observability describes its lifecycle events, history and search attributes.

Worker function​

auto-swe-worker is a Temporal serverless worker. Temporal Cloud invokes it for each workflow or activity task, through a role that only Temporal can assume. Every model call, sandbox operation and tool call is an activity on this worker. Internals describes the code, and Deploying auto_swe describes how each version is published and registered.

Daytona sandboxes and the egress proxy​

Each step run executes its commands in a Daytona sandbox with the repository checked out. The sandbox holds a placeholder for each credential its agent declares. Daytona's egress proxy replaces a placeholder with the credential's value only in HTTPS requests to that credential's hosts: GitHub, Linear, Nessie and Dagster+.

GitHub API calls from the worker​

The worker calls GitHub's API itself, with an installation token it mints for each call. It calls the API to:

  • load a pull request's context;
  • resolve plugins;
  • mint the tokens that the sandbox's Secrets hold;
  • run registered tools, such as github_post_comment.

Security model describes writes, and Tokens on the worker lists each call's permissions.

Bedrock and LangSmith​

The worker makes the model calls of the repository's agents through Amazon Bedrock, with its own AWS credentials. Each model call runs as a model activity. The worker sends a trace of each step run to LangSmith. Observability describes the traces.

AWS MCP Server​

For an agent that declares the AWS MCP Server, the worker assumes the auto-swe-agent-readonly role and mints an OAuth token with that role's credentials. The worker then calls the server's tools, so the sandbox holds no AWS credential. MCP tools describes the configuration and the role. Security model describes the role's limits.

Secrets Manager and the credential-expiry table​

Both functions read their secrets from Secrets Manager at cold start. The worker also reads the values that its credential providers need, such as the Linear OAuth clients' credentials and the Nessie reader token. It records each credential's expiry in the DynamoDB table auto-swe-credential-expiry, so every worker reads the same expiry. Deploying auto_swe lists the secrets, and Internals describes the credential refresh.

Payload bucket and the codec server​

The external payload storage of ai_temporal writes each payload of 64 KiB or more, such as a conversation, to the S3 bucket ai-ordering-payloads-prod. History holds a reference to the payload. ai_ordering's codec server reads the bucket, so the Temporal Cloud UI shows those payloads. Deploying auto_swe describes the setup. Security model describes which applications can read the shared bucket.

A work item, from the webhook to a write​

The session schedules each step from loading the pull request's context to github_post_comment as an activity. Temporal Cloud invokes the worker to run each activity. In a dry run, the harness does not run github_post_comment's activity. How a session runs describes the step run in order.