Editor’s note
Today’s issue is an edited excerpt from Harness Engineering: Design Patterns for Securing Long-Horizon Multi-Agent AI Systems by Ken Huang. Ken works where agentic AI meets security: he co-chairs AI safety work at the Cloud Security Alliance and contributes to OWASP’s work on AI risk.
I picked this section because it gets past the familiar instruction to “add guardrails.” A long-running agent does not merely make more tool calls. It starts blurring the boundaries between data and instructions, users and services, development and operations, and eventually one agent and an entire fleet.
Those boundaries were designed around software whose authority is usually confined to a request, a service, or a deployment. Long-running agents can cross all three as they retain state, delegate work, and continue acting while conditions change. That is why I wanted to share this section: it shows why safety must govern the agent’s entire trajectory, rather than rely on a prompt or a final-output check. Let’s get into it?
Build AI agents that can access tools without exposing secrets
Agents need to call APIs, query databases, and connect to MCP servers. But long-lived credentials risk leaks, and broad permissions make it harder to control or audit their actions. How do you give agents the access they need without putting secrets in their hands?
Join Infisical for a technical walkthrough of how to:
Broker credentials through a proxy so agents never see secrets
Limit access to specific endpoints and MCP tools
Use short-lived session tokens and act on behalf of users
Trace agent actions back to a person and session
See the architecture in a live demo and leave with practical patterns for your own stack.
Long-horizon agents are becoming normal because the economic value of agents lies precisely in work that takes multiple steps. Users do not need an agent to answer every simple question. They need an agent to carry work across interfaces, remember constraints, coordinate subtasks, and adapt when the environment changes. A short-horizon assistant can summarize a meeting. A long-horizon agent can read the meeting, update the project plan, assign follow-ups, draft messages, check calendar constraints, and return later with status. A short-horizon coding assistant can explain a function. A long-horizon coding agent can reproduce a bug, inspect the codebase, modify tests, patch the implementation, run validation, and prepare a pull request. A short-horizon security assistant can explain an alert. A long-horizon security agent can enrich indicators, correlate logs, search cases, draft containment steps, and monitor for recurrence.
The external indicators now point in the same direction. METR’s time-horizon work treats the length of tasks agents can complete as a measurable capability frontier, while Stanford HAI’s 2026 AI Index reports rapid movement in coding and agent-relevant benchmarks alongside broad organizational adoption (METR 2025; Stanford HAI 2026). The point is not to predict a precise date when agents can finish every multi-day project. The point is more immediate: as the tasks become longer, the security problem shifts from response filtering to trajectory governance. A system that is safe for one turn may be unsafe when it can keep trying, delegate, remember, pause, resume, and act under changing conditions.
The boundary collapse begins with time
In a request-response system, the developer can reason about one transaction at a time. In a long-running agent, the transaction may last hours. During that time, credentials can expire, policies can change, external systems can update, dependencies can fail, and the user’s intent can become stale. The harness must therefore manage time explicitly. It needs leases, timeouts, checkpoints, resumable state, stale-context detection, approval expiration, and durable traces. It must distinguish between a paused run, a failed run, a completed run, and a run that should be abandoned because its original assumptions no longer hold.
The second collapse is between data and instruction
In ordinary software, code is code and data is data. In agent systems, natural-language data can behave like instruction because the same model reads both. Anthropic’s computer-use documentation warns that Claude may follow commands found in web pages or images even when they conflict with developer instructions, and it recommends isolation from sensitive data and actions, minimal privileges, allowlisted internet access, and human confirmation for consequential actions (Anthropic 2026). OWASP’s prompt injection guidance similarly emphasizes input validation, separation of instructions from data, least privilege, output monitoring, and the limitations of current defenses (OWASP 2026).
The third collapse is between user and service
Agents often act “on behalf of” a user, but they do not behave exactly like the user. They may run when the user is offline. They may call tools faster than a human. They may forget social context that a human would remember. They may combine data from sources the user would not have considered together. They may take actions that the user could technically take but would not approve in that context. Identity and authorization systems built for human clicks and service-to-service calls are not sufficient unless extended to represent agent actor, delegated purpose, task scope, and evidence.
The fourth collapse is between development and operation
In traditional software, developers ship a version and operations monitor it. Agent harnesses are often changed through prompts, tool descriptions, retrieval policies, memory content, and evaluator thresholds. These changes can alter behavior as much as code changes, but they may not pass through the same review pipeline. If an agent can also propose or apply improvements to its own operating files, the line blurs further. This is where hill climbing becomes a governance problem. Improvement must be treated as change management, not as casual prompt tweaking.
The fifth collapse is between single-agent and fleet behavior
A single agent with a narrow tool set may be manageable through local controls. A fleet of agents can create emergent load, conflicting actions, duplicated work, stale summaries, and accidental collusion through shared memory or shared tools. A research agent may spawn subagents for market analysis, legal review, and technical due diligence. A coding agent may delegate test generation, documentation, and migration planning. A security agent may coordinate detection, triage, and response agents. Each subagent may be reasonable, but the fleet can exceed rate limits, overwhelm human approvers, or create inconsistent state.
These collapses explain why the harness cannot be postponed. They are not exotic edge cases. They are normal consequences of giving models tools, memory, and time. The deeper point is that they reinforce one another. A longer task horizon makes stale context more dangerous; delegated authority makes tool mistakes more consequential; prompt and memory changes become operational changes; and fleet behavior turns local mistakes into system behavior.
Take the argument further
This excerpt introduces the problem. In Harness Engineering, Ken Huang develops the control plane that comes next: autonomy budgets, scoped agent identities, intent contracts, context containment, governed memory, runtime intervention and fleet-level recovery.
If your agents are moving beyond short, supervised tasks, the rest of the book offers an architecture for keeping their authority visible, bounded and recoverable.
That’s it for this one. We’ll pick up the conversation next week.
Until then, keep building.
Tanya D’cruz
Editor-in-Chief




Thanks
Data turning into instruction is what would change how I test. Once a retrieved document can act as an instruction, a prompt check at the start is not enough. I would re-check at each tool call, and bind approval to the exact action. How do you handle an approval that stays valid while the task drifts?