Agent harness security

The model proposes. The harness acts.

An agent is a model plus a harness: the loop that feeds it context, hands it tools, holds its memory and carries its credentials. That is where a suggestion becomes an action. It is your highest-value control point, and most teams have never drawn it.

If your agent did something it shouldn't tonight, which component would stop it, and how would you prove it did?

  • Eight trust boundaries, named.
  • The decision point sits outside the model.
  • Residual risk scored, with the formula shown.

Already shipped · Open source · Evidence-rated

We mapped every boundary, shipped the enforcement, and rate our own evidence in public.

Agent harness security is the set of controls around a model's execution loop that decide which context it sees, which tools it may call, with what authority, under which approvals, inside which boundary, and what evidence each action leaves. A secure harness is identity, bounded authority, a policy decision point, a sandbox, state integrity, telemetry and recovery.

Last updated Tested against AI SAFE² v3.1 · safe2 CLI 1.1.0 · Gateway v3.0 · NEXUS v0.6By Vincent Sullivan

Trust boundary

Context

Boundary
Where untrusted text can become an instruction.
How it fails
Prompt injection through repo files, web pages, email, tickets or RAG.
Control
Tag and isolate untrusted sources. Never let data carry authority.
AI SAFE² anchor
P1 Sanitize and Isolate

Trust boundary

Tools

Boundary
Everything the agent can call, including MCP servers.
How it fails
A malicious or over-scoped server, or a tool description that rewrites the task.
Control
Allowlisted tools. Score and scan MCP servers before trust.
AI SAFE² anchor
CP.5.MCP, MCP-1 to MCP-19 · safe2 scan mcp

Trust boundary

Memory

Boundary
What persists between sessions.
How it fails
One poisoned write becomes a belief the agent acts on for weeks.
Control
Reviewed writes, provenance on every entry, rollback.
AI SAFE² anchor
P1 Sanitize and Isolate · P3 Fail-Safe and Recovery

Trust boundary

Credentials

Boundary
Who the agent acts as.
How it fails
A long-lived token carrying a human’s full scope.
Control
Task-scoped, short-lived, brokered credentials per non-human identity.
AI SAFE² anchor
CP.4 Agentic Control Plane Governance

Trust boundary

Policy gate

Boundary
Allow, deny or escalate, decided before execution.
How it fails
The model decides for itself whether its action is acceptable.
Control
A decision point outside the model. Default deny. Versioned policy.
AI SAFE² anchor
CP.4 Agentic Control Plane Governance

Trust boundary

Sandbox

Boundary
What a compromised step can still reach.
How it fails
Egress, cloud metadata, mounted secrets, writable config.
Control
Isolation tier chosen by threat, egress allowlist, protected paths.
AI SAFE² anchor
P1 Sanitize and Isolate

Trust boundary

Approvals

Boundary
Where a named human decides.
How it fails
Approval fatigue turns review into a rubber stamp.
Control
Show the consequence. Scope the approval. Make it expire.
AI SAFE² anchor
CP.10 HEAR Doctrine · gateway HITL circuit breaker

Trust boundary

Ledger + brakes

Boundary
What proves it happened, and what stops it.
How it fails
No trace for the post-mortem. No way to halt mid-run.
Control
Receipts per action, kill switch, token revocation, rollback.
AI SAFE² anchor
P2 Audit and Inventory · P3 Fail-Safe and Recovery · gateway HMAC audit chain, SafeMode
Proposed actions leave the model and meet the policy ring inside the harness: allowed through, denied, or held for a human. Tap any of the eight components to see its boundary, how it fails, the control, and the AI SAFE² anchor.

How do you secure an AI agent harness?

Built for platform and ML-platform teams running agents in production

The short answerYou secure an AI agent harness by naming the eight boundaries around the model — context, tools, memory, credentials, policy gate, sandbox, approvals, ledger — and enforcing each one outside the model with default deny. The page ships the enforcement: open-source CLI, gateway, and reference implementations, with evidence ratings on every claim. It fits teams running agents with real authority in production: if your agent can change production, move money, or move data, the harness is the control point. For sandboxed experiments, scoped credentials and egress limits are enough.

Disclosure: the open-source CLI, gateway, and reference implementations linked on this page are published by CSI.

02 · Where you are

Three questions about your agent harness

Tap the answer closest to true today.

Whose harness runs your agents?

The vendor governs its platform. Your tools, data and credentials are still yours to bound. Map them on the eight boundaries.

LangGraph, CrewAI and AutoGen already have governed examples. See the framework table.

Then you own every boundary. Start with the policy gate and the ledger. The grader shows where you stand.

Where does the policy decision happen?

A prompt is a request, not a control. The model can be talked out of it. Move the rule to policy as code for tool calls.

Scattered checks drift. One versioned decision point gives one answer and one receipt. See the reference loop.

Good. Now test it. A documented gate counts at half until it passes adversarial tests. See how to test.

What do the agent's credentials reach?

That is the target. Keep the brokering and add expiry if it is not there.

A shared account hides who acted. Every action needs the originating user on the receipt. See the control matrix.

Then one injected instruction acts with that person's full authority. Read the delegation path.

03 · What changes

Why is agent harness security different from application security?

An application does what its code says. An agent does what the model proposes and the harness allows. The harness is where authority lives.

QuestionApplication securityAgent harness security
Control flowFixed in code, reviewed before releaseChosen at runtime by the model, from context
Untrusted inputValidated at known entry pointsAny text the agent reads can carry an instruction
AuthorityService identity with fixed scopesDelegated from a human, often too broad, often long-lived
Enforcement pointAPI gateway and authorization middlewareA policy decision point between proposal and execution
EvidenceRequest logsReceipts linking actor, user, task, policy version and verdict

04 · The evidence

What the vendors' own documentation says about the harness

Host

MCP servers, command hooks and plugin monitors run as separate processes on the host, outside Claude Code's sandboxed Bash tool.

Anthropic Claude Code Docs · Oct 2026
Full

Until local sandboxing is enabled, Copilot's shell commands run with your account's access: read, write, network and credentials without restriction.

GitHub Docs · Oct 2026
19

MCP profile controls in AI SAFE² v3.1, including MCP-19 authorization chain integrity: issuer, audience and resource binding before any state change.

AI SAFE² CP.5.MCP · 2026

05 · Abuse paths

How does a harness get bypassed?

If you can't name the control point, what are you telling the auditor?

Tool description hijack

  1. AssetThe agent's task
  2. ActorThe operator of an MCP server
  3. PathA tool description tells the model to call a second tool first
  4. ResultData sent to a server nobody approved

Poisoned memory

  1. AssetLong-term memory
  2. ActorAnyone whose text the agent once read
  3. PathOne unreviewed memory write becomes a standing instruction
  4. ResultWeeks of actions on a false premise

Delegation drift

  1. AssetThe human's authority
  2. ActorA sub-agent three hops down
  3. PathEach delegation passes the full token, not a narrowed one
  4. ResultAn action no human would sign, under a human's name

06 · Architecture

What does a secure agent harness architecture look like?

Models propose. Infrastructure decides. Evidence proves. Every proposed action crosses the same five steps, and the gate is never the model.

  1. IdentityEach agent is a non-human identity, bound to an originating user and task.
  2. Bounded authorityShort-lived credentials scoped to the task, narrowed at each delegation.
  3. Policy decision pointAllow, deny or escalate, evaluated outside the model.
  4. SandboxThe sandbox layer of the harness limits what a compromised step reaches.
  5. Ledger and brakesA receipt per action, HMAC-chained. Kill switch, revocation, rollback.
The harness loop in five steps. The gateway reference implementation routes actions through AUTO, MEDIUM, HIGH and CRITICAL risk tiers and writes HMAC-SHA256 chained audit records.
Agent harness security diagram: the AI SAFE² control stack blueprint with policy, control, orchestration, model and infrastructure layers
The AI SAFE² control stack. The harness spans the orchestration and control layers, where runtime enforcement turns policy into decisions.

The rules the gate evaluates are written as policy as code for tool calls. MCP-specific controls live in the MCP security profile.

07 · Controls

Which harness controls map to which AI SAFE² anchors?

JobControlAI SAFE² anchorShipped artifact
PreventTag untrusted context. Allowlist tools. Scan and score MCP servers before trust.P1 · CP.5.MCPsafe2 scan mcp
ConstrainPolicy decision point outside the model. Default deny. Task-scoped credentials.CP.4 Agentic Control Plane GovernanceNEXUS
DetectRisk scoring per action: action, sensitivity and history.P4 Engage and Monitorgateway RiskScorer
RespondTiered human authorization for HIGH and CRITICAL actions.CP.10 HEAR Doctrinegateway HITL circuit breaker
RecoverSafeMode blocks traffic until operator recovery. Token revocation and rollback.P3 Fail-Safe and Recoverygateway SafeMode
ProveTamper-evident receipts and a Decision Card for leadership.P2 Audit and Inventoryaism-decision-card

08 · How to test

How do you test an agent harness?

Test the boundaries, not the model. Positive and negative cases with kept results rate E3.

1. Gate bypass E3
  1. Call a tool directly, skipping the agent loop.
  2. Call it through the agent with an instruction to skip checks.

Pass

Both paths hit the same decision point and produce receipts.

Fail

Either path reaches the tool without a decision.
2. Tool description injection E3
  1. Register a test MCP server whose description asks for another tool's output.

Pass

The server is flagged before trust, and the cross-tool call is denied.

Fail

The model follows the description.
3. Delegation narrowing E3
  1. Have a sub-agent request a scope its parent did not hold.
  2. Push delegation past the depth limit.

Pass

Both are denied, with the chain on the receipt.

Fail

The broader scope is issued.
4. Ledger tamper E3
  1. Edit one stored audit record.
  2. Run chain verification.

Pass

Verification fails at the edited record and SafeMode engages.

Fail

The edit goes unnoticed.
5. Kill switch E3
  1. Halt a running agent mid-task and time it.
  2. Confirm its credential is revoked.

Pass

No action after the halt; the token no longer works.

Fail

Queued actions complete, or the token stays live.

09 · Proof in public

We did the work in public. Check it.

Every number below links to the file that proves it. Fork it, run it, try to break it.

They define the risk. We ship the enforcement.

These bodies are the mapping targets, not the competition. AI SAFE² maps to them, then ships the code they leave to you.

Risk frameworks and runtime vendors compared with AI SAFE² on what each one publishes
WhoDefines the riskMaps to complianceOpen enforcement code for named agent stacksRates its own evidence in publicPublished bypass process
OWASP GenAI Security ProjectYesPartialNot its scopeNoNo
NIST AI RMFYesYes, it is the targetNot its scopeNoNo
MITRE ATLASYesPartialNot its scopeNoNo
CSA MAESTRO and Agentic Control PlaneYesPartialNot its scopeNoNo
Runtime security vendorsPartialPartialClosed, own product onlyVendor reportsSome, through bug bounties
AI SAFE²Yes, 161 controlsYes, 32 frameworksYes, 22 examples, CLI, gatewayYes, E0-E5Yes, Challenge Lab

As of October 2026 · Got one wrong? Send the link. We correct it the same week.

Challenge Lab · C0 to C5 claim maturity

Break it.

Preregistered scenarios. Explicit invalidation criteria. A valid bypass or a grader defect is a high-value contribution, and it goes into the public record.

Or run it on yours, now

$ pip install "ai-safe2[all]==1.1.0"
$ safe2 doctor .
$ safe2 gate project . --fail-under 70
$ safe2 scan mcp https://your-host/mcp

Four commands. No sales call. If the gate fails, you just learned something your current vendor did not tell you.

Install line from MIGRATION.md. Commands from the safe2 CLI reference.

10 · Tools

Which agent frameworks already have a governed harness?

FrameworkGoverned exampleWhat it governs
LangGraphlanggraph-sovereign-runtimeRuntime controls for stateful agent graphs
LangChainlangchain-sovereign-runtimeChains and tool-calling agents
CrewAIcrewai-sovereign-runtimeCrew-based orchestration
Microsoft AutoGenautogen-sovereign-runtimeMulti-agent orchestration
OpenClawopenclawTwo-layer stack: identity and memory files plus scanner and gateway
Supervisory agentishiReviews plans before high-risk actions run

From examples/README.md · October 2026

11 · Start here

Score your harness

Seven sliders, one checkbox. The formula is printed under the result.

Free · Agent Harness Risk Grader · 0 none to 4 maximum

What can it change?
How broad and lasting are its permissions?
How much untrusted input reaches it?
What stays unreachable after compromise?
What is blocked before execution?
How often are controls tested?
Can you stop, revoke and roll back?
Residual riskHIGH

Untested controls count at half. Weakest control: preventive enforcement. Raise it first.

Residual = consequence × authority × exposure, reduced by verified containment, prevention, assurance and recovery. A documented policy is not a passing enforcement test, so untested controls count at half.

Email me the PDF scorecard

What the review adds

The grader takes your self-scores. The review replaces each one with a test result, so the residual number is evidence, not opinion.

Productized review

Agent Harness Security Review

Scope
One agent system and its harness: context, tools, memory, credentials, gate, sandbox, approvals and ledger.
Deliverables
A trust-boundary map, PDP and PEP design, kill and rollback plan, and a test report for each boundary.
Timeline
Agreed in writing at scoping, before work starts.
Risk reversal
Every finding ships with the test that proves it. No test, no finding.
  1. Agent Harness Risk GraderFree, result on this page
  2. Free 8-minute AI governance assessmentScore your AI risk
  3. Strategic Certainty SessionA fixed-scope working session
  4. Agent Harness Security ReviewCustom quote
  5. Secure AI Development ArchitectureEnterprise program

13 · FAQ

Straight answers on agent harness security

Is the Harness Risk Grader a certification?

No, and nothing honest is. It is decision support with the formula printed under it. Untested controls count at half, because a documented policy is not a passing enforcement test. The full review replaces your self-scores with test results.

Does installing AI SAFE² make my agent conformant?

No framework does that by installation, ours included, and we put that sentence in our own repo. Conformance means the control outcomes are met and the evidence exists. We ship the controls, the code and the evidence method. You still have to run them.

Who validates CSI's claims?

Every claim carries an E0 to E5 rating under our published Evidence Assurance method. E4 requires a named independent evaluator. Where we have one, we name them. Where we don't, the rating says so. The code is public, so you can be the evaluator.

Why should I trust a framework author over my platform vendor?

Don't trust either. Check. Your vendor governs its own product. AI SAFE² governs across Claude Code, Codex, Cursor, LangGraph, CrewAI and the rest, maps to 32 frameworks, and publishes the code that does it. One of those can be audited by anyone today.

What does "agent harness" mean, exactly?

The industry uses it three ways: a coding harness, an orchestration framework, and a security wrapper. We mean the whole loop around the model: context, tools, memory, credentials, the policy gate, the sandbox, approvals and the ledger. If a control is not in that loop, it is not governing the agent.

Is NEXUS required?

No. NEXUS is CSI's reference implementation for agent-to-agent and agent-to-tool enforcement. Any implementation that meets the control outcomes and produces reconstructable evidence satisfies AI SAFE².

14 · Sources and method

Sources, method and update log

Method

External statistics name the publisher, year and sample. CSI claims link the repository file behind them and carry a rating under AI SAFE² Evidence Assurance v1.0: E1 for a specification, E2 for shipped code, E3 for a defined test with positive and negative cases. Vendor behavior comes from each vendor's current documentation, opened on the date shown.

Update log

  • : page published. Vendor controls, repository counts and install line verified the same day.

Tested versions

AI SAFE² v3.1 · CP.5.MCP MCP-1 to MCP-19 · safe2 CLI 1.1.0 · Gateway v3.0 · NEXUS v0.6 · Evidence Assurance v1.0

Vincent Sullivan

Vincent Sullivan, founder and CEO of Cyber Strategy Institute. Twenty-two years as a U.S. Air Force cyber officer, finishing as Technical Director at U.S. Cyber Command. Author of the AI SAFE² framework.

About CSI and the team

Find your exposure first. Free AI governance assessment — instant score, no sales call required. Score Your AI Risk in 8 Minutes Book a Strategy Briefing Cyber Strategy Institute

Prevention, not detection. Engineered certainty for AI governance, endpoint defense, and critical infrastructure.

1207 Delaware Ave #3397
Wilmington, DE 19806

Solutions

AI Governance

Industries

Company

© 2019–2026 Cyber Strategy Institute. All rights reserved. Privacy Policy Terms of Service

Stop Threats Before They Execute

Your free Kernel-Level Defense Buyer’s Guide is ready to download.

By providing my email address, I consent to receive emails and text messages—including newsletters and marketing communications—from creators of Warden Secure, Cyber Strategy Institute, our flagship zero-trust platform for ransomware prevention, and agree to the Terms and Privacy Policy. You may unsubscribe at any time.