START HERE

What you will learn

  • Separate a model from its execution environment.
  • Design a minimum runtime contract.
  • Check containment and recovery before connecting real systems.

Before you start: For stakeholders, independent builders and technology leaders. Bring one workflow or software change you can describe.

A model proposes; a runtime makes execution possible

A model can suggest a command, but something must decide whether that command may run, supply its working directory, execute it and return the result. That surrounding machinery is the runtime. It also needs to handle cancellation, timeouts and the state left behind after a crash.

A runtime is not necessarily a VM, and one agent role does not require its own server. Roles can run as separate jobs inside an approved architecture. Choose boundaries based on trust, data and workload rather than assuming a particular cloud product provides all of them.

What a useful runtime contract contains

Record the permitted workspace, supported tool interfaces, credential scopes, network destinations, resource ceilings and approval rules. Describe which state survives a restart and which working files are disposable. A task should have an execution ID that connects its logs and outputs to the correct customer and source revision.

Writing “no production access” in a prompt does not remove a production credential from a process. Enforce the boundary through identities, credential delivery, network policy and the worker environment. Containers need deliberate configuration; setting a CPU or memory limit alone is not proof of tenant isolation or network restriction.

Design failure as part of normal operation

A cancelled job may have already called a remote API. Killing its container does not undo that action. Distinguish local process termination from remote cancellation and business recovery. Use idempotency or reconciliation where the target system supports it, and escalate ambiguous outcomes instead of blindly retrying.

Keep agent-visible work logs separate from operator security records. Redact secrets and personal data. Record enough to investigate a failed execution without treating unlimited raw transcript retention as observability.

Step-by-step process

  1. Define one allowed task

    Choose a read-only investigation or a branch-only code change. Name the required tools and the operations that must remain unavailable.

  2. Provision a disposable workspace

    Create a checkout for the selected revision and a separate job identity. Supply credentials at execution time from an approved secret store.

  3. Apply limits independently

    Enforce time, CPU, memory, network and spending limits using the relevant host, provider and orchestration controls. Confirm which controls are actually implemented.

  4. Exercise termination and restart

    Stop a long-running task, inspect for child processes and remote work, then restart with an explicit policy for retained state.

FOLLOW ONE EXAMPLE

Worked scenario

Investigating a bug without production credentials

A fictional technical lead wants an agent to reproduce a search bug without touching customer records.

  1. The worker receives a repository revision and a synthetic database fixture.
  2. An attempted connection to a live database is denied by the environment, regardless of what the agent requests.
  3. A timeout stops local processes; the reviewer checks that no remote jobs or accessible credentials remain.

What this shows: The test establishes a specific boundary in that environment. It does not establish universal containment against every attack.

The process at a glance

The runtime surrounds tool execution with permissions and lifecycle controls; a model’s willingness to comply is not the enforcement boundary.
ProcessDecisionHuman checkpoint
Read Mermaid diagram source
flowchart TD
 A[Approved task] --> B[Runtime supervisor]
 B --> C[Workspace and scoped identity]
 C --> D{Permission check}
 D -->|Allowed| E[Tool execution]
 D -->|Denied| F[Record refusal]
 E --> G[Output and resource records]
 B --> H[Timeout and stop controls]

What you should have at the end

  • A runtime contract tied to a particular task class.
  • Evidence for denied access, cancellation and workspace cleanup.

Common mistakes and how to avoid them

Confusing instructions with controls

An agent can misunderstand a rule. Make forbidden operations unavailable to its credentials and environment.

Assuming termination reverses effects

Inventory remote actions and define reconciliation before enabling writes.

APPLY THE IDEA

Try it yourself

Your task: Design a runtime for a branch-only documentation correction.

What to produce: An access matrix plus tests for denied production access and timeout cleanup.

Check your understanding: Can you demonstrate the denied operation independently of the agent’s response?

Key terms in plain English

Runtime
The machinery that executes and supervises agent work.
Execution identity
The account or credentials under which a job acts.
Idempotency
A mechanism for avoiding repeated business effects when a request is retried.

Sources and further reading