Pull Request Delivery as a First-Class Cloud Workload How Managed Agent Platforms Wire Claude Code to GitHub Output
Managed agent platforms separate session state, execution.

A cloud coding agent runner with a bring-your-own API key needs more than access to a model to reliably deliver a pull request. Running Claude Code or Codex without managing infrastructure requires a platform to handle session state, isolated execution, repository credentials, and GitHub tooling.
Why delivering a PR from a cloud agent is an architecture problem, not a configuration step
Pointing Claude Code at a repository and assigning a task can look sufficient when an engineer remains available to resolve failures. A background agent has a different obligation. It must persist through multi-step execution, maintain authenticated repository access, and produce an artifact that someone can review. Each depends on infrastructure beneath the agent, and each can fail independently.
The architectural separation is between the session, the harness, and the sandbox. The session is an append-only event log and the task’s source of truth, while the harness is the stateless loop that calls the model and routes tool calls. The sandbox is where code actually runs. If the harness crashes, a replacement can resume from the session log, and if the sandbox is killed, the session survives. Claude Managed Agents, launched April 8, 2026 in public beta, operationalizes this separation through APIs for sandboxed execution, checkpointing, credential management, scoped permissions, and end-to-end tracing.
How the session layer keeps a long-running agent on track
The session is the component that must survive the entire task lifecycle. The harness and sandbox are stateless and replaceable, but losing the durable task record means losing the basis for resumption. In the managed model, that record lives outside the model itself. The harness queries specific slices of the event log rather than placing the entire history into the active context window. This lets a multi-hour task retain a usable history without requiring every earlier event to remain in context.
The harness can still query past events after compaction removes them from Claude’s immediate context, so earlier edits and test runs can still guide later work. Context and durability are therefore separate concerns. The active window contains what the model is currently using, while the log preserves events that the harness can retrieve. This provides continuity within a session.
Claude Code’s Tasks feature keeps task state by writing it to ~/.claude/tasks. The notes describe that state as surviving terminal shutdowns and supporting continuity across machine switches. Setting CLAUDE_CODE_TASK_LIST_ID lets multiple Claude instances use the same task list and work together without external orchestration tools. Cross-session memory serves a different purpose again. It preserves information such as preferences, prior summaries, and session history across separate invocations. Multi-agent coordination and persistent cross-session memory are in public beta, while the related memory-consolidation feature is still in research preview.
What the sandbox actually provides, and what it does not
The sandbox supplies the execution environment for installing packages, running tests, committing code, and pushing branches. Its isolation rules govern whether that work can affect systems outside the task’s intended scope. Execution access is not itself an isolation guarantee. Managed Agents provisions each session in its own isolated environment, pre-configured with the team’s dependencies and tooling. The agent can then run services, drive a browser, and verify its output without contaminating other sessions or the host system.
On Linux, Claude Code uses Bubblewrap, the technology that also powers Flatpak, while macOS deployments use the Seatbelt framework. Both are enabled through /sandbox or the sandbox.enabled setting in settings.json. Deployments that omit this setting, including most CI/CD integrations described in the brief, run without agent sandboxing.
The prompt injection risk that unsandboxed CI agents inherit
An agent can encounter instructions inside content that should be treated as task data. PR descriptions, issue comments, and commit messages are examples, particularly when external contributors can supply them. Access to secrets makes this boundary consequential. If untrusted content redirects an agent’s actions, the tools available to that agent determine what the redirected workflow can reach. Security therefore depends on both the instructions the model receives and the credentials its execution paths expose.
Microsoft Defender Security Research found a specific mismatch in Claude Code Action’s protections. The action supported environment scrubbing for subprocess execution paths such as Bash, but the Read tool was not subject to the same sandboxing model. It was authorized to access /proc/self/environ. That access allowed it to read the workflow’s ANTHROPIC_API_KEY and potentially other credentials available to the runner. The finding is limited to this documented tool boundary and leaves open whether other GitHub integrations have the same vulnerability.
The architectural lesson is narrower than a blanket rejection of CI agents. Workflows that process untrusted GitHub content while holding repository secrets or cloud credentials have an elevated exposure to prompt injection. This makes tool access and credential placement part of the same design problem. GitHub authentication adds another credential surface that the pipeline must manage explicitly.
How GitHub authentication is wired into a managed session
Connecting a managed session to GitHub begins with mounting the repository as a resource. In the session creation call, the resources array contains the repository entries, each with its own mount_path and token. The mount makes the repository available to the task, while authorization determines which remote operations can succeed. The GitHub MCP server is connected as a separate part of the setup. Together, these connections support cloning, branching, committing, pushing, and opening a pull request.
Missing credentials produce different outcomes for public and private repositories. A public repository can clone without a token, and the agent can commit changes locally, but git push fails. No PR can then be opened from that unpushed work. A private repository fails earlier because it cannot clone after session creation.
Token scope also depends on the intended operation. Cloning private repositories and creating PRs requires the repo scope, while creating issues on public repositories requires only public_repo. The token is not echoed in API responses. Multiple repositories can be mounted by adding resource entries, each with a separate mount path and token.
Authorization remains adjustable after the session starts. Repository resources can be listed through client.beta.sessions.resources.list(), and their authorization tokens can be updated using each resource’s id. This is significant for long-running work because tokens may expire before the task finishes. GitHub repositories are also cached across sessions, allowing later sessions using the same repository to start faster.
What the GitHub MCP server enables beyond a bare git push
A pushed branch is not yet a pull request. Raw git operations move code, while the GitHub MCP server supplies the GitHub-specific tooling that turns that work into a reviewable workflow. Its connectivity is explicitly controlled. The environment’s networking configuration must set allow_mcp_servers to true to permit outbound MCP connections from the sandbox. Mounting a repository therefore does not, by itself, authorize the agent’s external MCP reach.
Project instructions enter through another mechanism. Skills in the repository root’s .claude/skills directory load automatically when the repository is mounted, giving the agent project-specific conventions and tooling without additional configuration. Discovery occurs once per session. It uses the repository state checked out at session start, which distinguishes skill loading from an assumption that repository instructions are continually rediscovered. Skills guide the work, while MCP defines the available GitHub interactions.
The official Claude Code Action example creates branches named claude-auto-fix-ci-${SAFE_BRANCH}-${RUN_ID} and checks for the claude-auto-fix-ci- prefix to prevent an infinite loop. The documented convention differs from fix/auto-ci-{run_id}. For teams customizing PR behavior, MCP is the layer where GitHub-specific choices such as labels, assignees, and draft status belong.
How production teams have assembled this pipeline end-to-end
Ramp’s Inspect shows the path from delegation to sandboxed work. A session can begin on the web, through a Chrome extension, or in Slack, where “@Inspect, fix this” can be enough to start. Execution runs in sandboxed VMs on Modal. Inspect can access databases, CI/CD pipelines, Sentry, Datadog, feature flags, and Slack, giving the task access to operational context beyond source files. Linear’s customer account describes its context as including years of specifications, customer requests, and roadmaps stored in Linear.
By May 2026, Inspect wrote a substantial majority of the PRs Ramp merged. The system connects an accessible delegation surface to an execution environment and enterprise tools, with its breadth of access illustrating why permissions belong in the architecture. The useful context and the systems an agent can affect are parts of the same integration.
Coinbase’s Forge serves engineers through Slack, Linear, and GitHub. It produces a meaningful share of merged PRs and has substantially reduced PR cycle time. Coinbase also built Mux, an internal multi-agent orchestration layer that began as one engineer’s personal project and expanded to broad use across many repositories. Mux users merge significantly more PRs per engineer than non-users. Coinbase qualifies that comparison because Mux users likely skew toward engineers who were already high-output, so the difference is not evidence that orchestration alone caused the improvement.
LangChain identified Stripe’s Minions, Inspect, and Coinbase’s Cloudbot, also called Forge, as independent implementations of the same architectural pattern. It open-sourced that pattern as Open SWE. The implementations converged on cloud sandboxes, Slack and Linear invocation, subagent orchestration, and automatic PR creation.
Linear extends that delegation model at the platform level. Its own agent reads an issue and its surrounding discussion, proposes an approach, writes code, and opens a pull request in the cloud using harnesses including Claude Code or Codex. Third-party agents such as Cursor, Codex, and Copilot follow the same workflow on their vendors’ infrastructure. Assigning work to an agent is like assigning an issue to a human engineer.
What the pipeline means for teams choosing how to run it
A team that builds its own pipeline with GitHub Actions and bare Claude Code has control over its parts. It also leaves session durability, credential rotation, sandboxing, and loop prevention with that team when no managed session layer is present. The team still has to handle that work after a successful demonstration. Managed platforms instead handle the session log, harness lifecycle, sandbox provisioning, credential scoping, and GitHub wiring as infrastructure.
For a bring-your-own API key buyer, credential support is a separate criterion from managed execution. Harness flexibility is another distinct criterion. A platform able to route tasks to Claude Code, Codex, Cursor, or Opencode preserves room to evaluate different agents without rebuilding the surrounding pipeline.
A durable session does not establish sandbox isolation, and repository access does not establish correctly scoped MCP connectivity. The final test is operationally concrete. Can the team explain what its agents cost, what they shipped, and which systems they could reach for every task?


