Build the Harness First: Permissions, Budgets, and Fail-Closed Gates for Production Agents

  created  by  Sherlock {{tag}}
创建于 2026年10月18日 22:20:07 最后修改于 2026年10月19日 00:31:19

If your agent can call tools, you do not have a product yet. You have a loaded weapon with autocomplete.

That sounds harsh on purpose.

The industry week around enterprise agents—Google’s Gemini agent with coworker identities and spend caps, open agent OS releases promising sandboxes and multi-agent swarms, personal agents that relocate control back onto user devices—keeps celebrating what models can reach.


Production teams should celebrate what models cannot reach without a gate. This essay is a field guide for that harness. It is not a translation of a Chinese checklist and not a vendor recap.

It is an opinionated engineering stance: capability is rented; control planes are owned.

Thesis


Model proposes, harness disposes

Fig: Capability is rented; control planes are owned


A production agent is a workflow engine that happens to use a model for planning. The model proposes. The harness disposes.


If you invert that relationship—if the model’s tool call is treated as an order rather than a request—you will eventually ship an incident that looks, in the logs, like competence.

Scene: the helpful refund


A support agent is told: “Make the customer whole.” In a demo, it drafts empathy, issues a partial refund, and closes the ticket.

In production, the same objective can fan out into PII fetches, policy exceptions, public channel posts, and a refund larger than the order value because a tool returned a stale currency field and nobody bounded the argument.


The failure is rarely “the model is dumb.” The failure is that read tools, write tools, and irreversible tools shared one permission persona, and the only confirmation UI was a chat bubble saying “continue?”

1) Permissions: cut blast radius before you add skills


Skill registries and MCP servers are accelerants. Treat them like production dependencies.

  • Classify tools by side effect, not by OpenAPI beauty: read, draft-local, externally visible write, irreversible.
  • Give the agent its own identity. Actions attributed to a human user are a gift to attackers and a nightmare for IR.
  • Constrain arguments in the tool layer: allowlists for tables, repositories, payment instruments, destination domains. Prompt-level “please don’t” is not a control.
  • Scope sub-agents even tighter. A research sub-agent does not need refund. A refund sub-agent does not need git push.


Google’s public enterprise story—agent identity, gateway policy, sandboxing—is directionally correct even if you never buy the stack. Steal the shape: non-human principal, least privilege, network boundary, audit that names the agent.


2) Confirmation: bind approval to an action digest


Human-in-the-loop systems fail in a boring way: the human approves a sentence; the runtime executes a different tool call that arrived a second later.

Public designs such as Microsoft’s action-bound, fail-closed approval protocol exist because of that class of bug.

Minimum rules that hold up in review:


  1. Serialize the exact tool name + canonical arguments + policy version into a digest.
  2. Approve the digest, not the vibe.
  3. On expiry, deny or escalate—never allow by silence.
  4. Re-validate digest and policy immediately before execution; consume one-time approvals atomically.
  5. Persist pause state (as OpenAI’s Agents SDK does with interruptible run state) instead of holding a request thread hostage.


If your confirmation UX cannot show “send $420.00 to vendor X on instrument Y,” you do not have a confirmation UX. You have a liability waiver with a button.

3) Timeout budgets: define what silence means


Temporal’s approval guidance is painfully transferable: no timeout means infinite wait; tight timeout means false rejects; missing escalation means stuck work. Agents add model latency and flaky tools on top.

Budget four clocks explicitly:


Clock Typical default On fire
Tool start-to-close 30–60s (heavy jobs: minutes + heartbeat) retry only if idempotent
Human approval hours, business-aware deny or escalate
Objective wall clock hours to a day pause + notify owner
Token / $ cap per project pause; require explicit resume


Pure timeout policies—deny, drop, escalate with a bounded counter—are easier to replay and audit than “ask the model what to do when we timed out.” Asking the model to adjudicate its own budget overrun is how loops eat your cloud bill.

4) Long tool returns: context windows reward sloppiness


A 1M-token window does not make dumping a warehouse extract into the prompt a strategy. It makes the mistake more expensive.

Harness rules that pay rent immediately:


  • Tools must declare max_rows / max_bytes and return continuation tokens.
  • The orchestration layer stores raw payloads in object storage and hands the model a handle plus a bounded summary.
  • Truncation is a first-class event in the trace. If the model never saw page 17, the log must say so.
  • Summaries used for decisions should carry citations back to handles, so a human can spot-check without re-running the whole agent.


The anti-pattern is “stuff everything into memory so the agent feels contextual.” That is how prompt injection rides in on a retrieved HTML page and hitchhikes into a privileged tool.

5) Parallelism: fan-out reads, serialize writes


Parallel tool calls are not a badge of agent modernity. They are a concurrency problem with an LLM in the scheduler.

Safe to parallelize: independent reads, multi-source fetch, static analysis across files.
Serialize or transactionalize: inventory decrement, payments, ACL changes, any read-modify-write on one entity.


Your orchestrator needs a dependency graph, a hard cap on in-flight calls, and a merge policy for conflicting evidence. “Let the parent agent decide” is acceptable only when the parent is forced to show the conflict to a human for irreversible paths.

Also separate ephemeral sub-agents (job-scoped, disposable identity, tiny toolbags) from coworker-style agents (persistent role, mailbox, long-lived memory). Mixing both lifecycles in one object model is how permissions metastasize.

6) What the orchestration layer actually owns


What the orchestrator owns

Fig: If it is only a prompt router, rename it honestly


If the orchestrator is only a prompt router, rename it honestly. A real harness owns:


  • a state machine for objectives (plan → act → await approval → join → finalize/abort);
  • version-pinned policies for the lifetime of a run;
  • model routing that records why a cheap model was chosen;
  • memory partitions (session, procedural skills, episodic traces) with promotion rules;
  • observability: call_id, approval id, latency, truncation flags, dollar burn;
  • terminal failure copy a non-engineer can understand.


This is why “agent OS” announcements keep rhyming across vendors. The market is rediscovering workflow engines, with LLMs as unreliable but useful planners.

7) A one-sprint harness hardening plan


One-sprint hardening plan

Fig: Ship nothing that fails the day-7 red team


Days 1–2: Label every tool L0–L3; kill shared admin tokens in staging and prod.
Day 3: Action-digest approvals for L2/L3; timeout defaults to deny.
Day 4: Per-objective token and wall-clock caps with pause semantics.
Day 5: Enforce pagination and summary handles; ban whole-payload prompting.
Day 6: Parallelism allowlist for reads only; write paths serial.
Day 7: Red-team: prompt injection via retrieved content, approval replay after arg drift, sub-agent privilege escape, deliberate mega-returns.

Ship nothing that fails these.


Closing stance


Use the current wave of agent launches as pressure, not as a shopping list. Steal their vocabulary when it is sharp—objectives over instructions, agent-attributed audit, spend caps, sandboxes—then implement the boring machinery yourself.

The teams that win the next year of agent adoption will not be the ones whose demos look the most autonomous. They will be the ones whose systems can refuse, pause, explain, and resume without inventing a new class of outage.

Build the harness first. Let the model earn more tools only after the gates already know how to say no.


8) Observability that survives a lawsuit


Pretty traces for developers are not enough. You need traces that survive a customer dispute and an internal audit:

  • store the objective text and the policy version hash;
  • store each tool call’s digest, approval decision, and executor identity;
  • store token and dollar burn per objective, not only per HTTP request;
  • store truncation and untrusted-content flags;
  • make export boring and complete.


If your agent platform cannot answer “why did we refund $420 at 02:14,” you do not have automation. You have folklore.

9) Organizational interface: on-call for agents


Agents create a new on-call shape. Someone must own: stuck approvals, budget pauses, poison retrieval, and connector outages. Write a runbook before the first SEV.


Include who can break-glass escalate an L3 action, how long break-glass lasts, and how it is audited afterward. Break-glass without expiry is just permanent privilege with better branding.

Closing addendum


Autonomy is not the goal. Bounded autonomy is. The harness is how you bound it. Ship that, and model upgrades become routine. Skip that, and every model upgrade is a new way to fail faster.

References


评论区
评论
{{comment.creator}}
{{comment.createTime}} {{comment.index}}楼
评论

Build the Harness First: Permissions, Budgets, and Fail-Closed Gates for Production Agents

Build the Harness First: Permissions, Budgets, and Fail-Closed Gates for Production Agents

If your agent can call tools, you do not have a product yet. You have a loaded weapon with autocomplete.

That sounds harsh on purpose.

The industry week around enterprise agents—Google’s Gemini agent with coworker identities and spend caps, open agent OS releases promising sandboxes and multi-agent swarms, personal agents that relocate control back onto user devices—keeps celebrating what models can reach.


Production teams should celebrate what models cannot reach without a gate. This essay is a field guide for that harness. It is not a translation of a Chinese checklist and not a vendor recap.

It is an opinionated engineering stance: capability is rented; control planes are owned.

Thesis


Model proposes, harness disposes

Fig: Capability is rented; control planes are owned


A production agent is a workflow engine that happens to use a model for planning. The model proposes. The harness disposes.


If you invert that relationship—if the model’s tool call is treated as an order rather than a request—you will eventually ship an incident that looks, in the logs, like competence.

Scene: the helpful refund


A support agent is told: “Make the customer whole.” In a demo, it drafts empathy, issues a partial refund, and closes the ticket.

In production, the same objective can fan out into PII fetches, policy exceptions, public channel posts, and a refund larger than the order value because a tool returned a stale currency field and nobody bounded the argument.


The failure is rarely “the model is dumb.” The failure is that read tools, write tools, and irreversible tools shared one permission persona, and the only confirmation UI was a chat bubble saying “continue?”

1) Permissions: cut blast radius before you add skills


Skill registries and MCP servers are accelerants. Treat them like production dependencies.


Google’s public enterprise story—agent identity, gateway policy, sandboxing—is directionally correct even if you never buy the stack. Steal the shape: non-human principal, least privilege, network boundary, audit that names the agent.


2) Confirmation: bind approval to an action digest


Human-in-the-loop systems fail in a boring way: the human approves a sentence; the runtime executes a different tool call that arrived a second later.

Public designs such as Microsoft’s action-bound, fail-closed approval protocol exist because of that class of bug.

Minimum rules that hold up in review:


  1. Serialize the exact tool name + canonical arguments + policy version into a digest.
  2. Approve the digest, not the vibe.
  3. On expiry, deny or escalate—never allow by silence.
  4. Re-validate digest and policy immediately before execution; consume one-time approvals atomically.
  5. Persist pause state (as OpenAI’s Agents SDK does with interruptible run state) instead of holding a request thread hostage.


If your confirmation UX cannot show “send $420.00 to vendor X on instrument Y,” you do not have a confirmation UX. You have a liability waiver with a button.

3) Timeout budgets: define what silence means


Temporal’s approval guidance is painfully transferable: no timeout means infinite wait; tight timeout means false rejects; missing escalation means stuck work. Agents add model latency and flaky tools on top.

Budget four clocks explicitly:


Clock Typical default On fire
Tool start-to-close 30–60s (heavy jobs: minutes + heartbeat) retry only if idempotent
Human approval hours, business-aware deny or escalate
Objective wall clock hours to a day pause + notify owner
Token / $ cap per project pause; require explicit resume


Pure timeout policies—deny, drop, escalate with a bounded counter—are easier to replay and audit than “ask the model what to do when we timed out.” Asking the model to adjudicate its own budget overrun is how loops eat your cloud bill.

4) Long tool returns: context windows reward sloppiness


A 1M-token window does not make dumping a warehouse extract into the prompt a strategy. It makes the mistake more expensive.

Harness rules that pay rent immediately:



The anti-pattern is “stuff everything into memory so the agent feels contextual.” That is how prompt injection rides in on a retrieved HTML page and hitchhikes into a privileged tool.

5) Parallelism: fan-out reads, serialize writes


Parallel tool calls are not a badge of agent modernity. They are a concurrency problem with an LLM in the scheduler.

Safe to parallelize: independent reads, multi-source fetch, static analysis across files.
Serialize or transactionalize: inventory decrement, payments, ACL changes, any read-modify-write on one entity.


Your orchestrator needs a dependency graph, a hard cap on in-flight calls, and a merge policy for conflicting evidence. “Let the parent agent decide” is acceptable only when the parent is forced to show the conflict to a human for irreversible paths.

Also separate ephemeral sub-agents (job-scoped, disposable identity, tiny toolbags) from coworker-style agents (persistent role, mailbox, long-lived memory). Mixing both lifecycles in one object model is how permissions metastasize.

6) What the orchestration layer actually owns


What the orchestrator owns

Fig: If it is only a prompt router, rename it honestly


If the orchestrator is only a prompt router, rename it honestly. A real harness owns:



This is why “agent OS” announcements keep rhyming across vendors. The market is rediscovering workflow engines, with LLMs as unreliable but useful planners.

7) A one-sprint harness hardening plan


One-sprint hardening plan

Fig: Ship nothing that fails the day-7 red team


Days 1–2: Label every tool L0–L3; kill shared admin tokens in staging and prod.
Day 3: Action-digest approvals for L2/L3; timeout defaults to deny.
Day 4: Per-objective token and wall-clock caps with pause semantics.
Day 5: Enforce pagination and summary handles; ban whole-payload prompting.
Day 6: Parallelism allowlist for reads only; write paths serial.
Day 7: Red-team: prompt injection via retrieved content, approval replay after arg drift, sub-agent privilege escape, deliberate mega-returns.

Ship nothing that fails these.


Closing stance


Use the current wave of agent launches as pressure, not as a shopping list. Steal their vocabulary when it is sharp—objectives over instructions, agent-attributed audit, spend caps, sandboxes—then implement the boring machinery yourself.

The teams that win the next year of agent adoption will not be the ones whose demos look the most autonomous. They will be the ones whose systems can refuse, pause, explain, and resume without inventing a new class of outage.

Build the harness first. Let the model earn more tools only after the gates already know how to say no.


8) Observability that survives a lawsuit


Pretty traces for developers are not enough. You need traces that survive a customer dispute and an internal audit:


If your agent platform cannot answer “why did we refund $420 at 02:14,” you do not have automation. You have folklore.

9) Organizational interface: on-call for agents


Agents create a new on-call shape. Someone must own: stuck approvals, budget pauses, poison retrieval, and connector outages. Write a runbook before the first SEV.


Include who can break-glass escalate an L3 action, how long break-glass lasts, and how it is audited afterward. Break-glass without expiry is just permanent privilege with better branding.

Closing addendum


Autonomy is not the goal. Bounded autonomy is. The harness is how you bound it. Ship that, and model upgrades become routine. Skip that, and every model upgrade is a new way to fail faster.

References



Build the Harness First: Permissions, Budgets, and Fail-Closed Gates for Production Agents2026-10-19Sherlock

{{commentTitle}}

评论   ctrl+Enter 发送评论