The Agent Harness Is Where AI Starts Acting. Security Has to Start There Too.
Intro
An AI agent is not just a model answering questions. It is a model wrapped in software that gives it memory, tools, context, permissions, and the ability to act.
That wrapper is often called the agent harness.
The Noma article frames the harness as the control layer that turns a language model into something usable inside real workflows. That distinction matters for security teams. The model may generate the next step, but the harness decides what context is assembled, which tools are exposed, what memory is reused, and whether an action is allowed to happen.
By the end of this blog, the reader should have a practical way to think about where agentic security lives: not only in the model, but across the boundaries where instructions, data, tools, memory, and actions meet.
Problem
Traditional application security assumes relatively clear separations.
Code is code. Data is data. Users have roles. APIs enforce permissions. Infrastructure boundaries are visible. Logs can usually tell you which service did what.
Agentic systems blur these lines.
A model receives system prompts, user messages, retrieved documents, tool outputs, prior memory, and policy context inside one operating surface. It does not naturally know which instruction is authoritative, which content is untrusted, which data is sensitive, or which action should require approval.
That creates a new kind of failure mode.
The real question is not only: “Can bad input enter the system?”
It will.
The better question is: “Which boundary fails after bad input enters?”
For example:
- If an email tells the agent to ignore its original task, that is an instruction-boundary problem.
- If a retrieved document is treated as trusted when it has been manipulated, that is a knowledge-integrity problem.
- If the agent calls a sensitive tool without validating intent, that is a tool-invocation problem.
- If untrusted user input is stored and reused later as memory, that is a memory-boundary problem.
- If a model-generated action executes without policy checks, that is an autonomy-control problem.
This is why agent security cannot be reduced to “secure the model.” The harness, retrieval layer, memory store, identity system, tools, APIs, and runtime policies all become part of the security surface.
Solutions
Security teams need to treat the agent harness as a control plane and then test the boundaries around it.
A practical approach starts with five questions:
- What content can enter the agent’s context?
- Which parts of that context are trusted, semi-trusted, or untrusted?
- Which tools can the agent call, and under what conditions?
- What memory can be written, retrieved, or reused?
- What checks happen before the agent takes an external action?
From there, controls should be split across two stages.
Pre-production testing:
- Red-team the agent using adversarial prompts as test cases.
- Test prompt injection, indirect prompt injection, data leakage, excessive agency, tool misuse, and policy bypass.
- Validate how the harness handles conflicting instructions.
- Check whether retrieval content can override system intent.
- Test whether tool calls follow least privilege and purpose constraints.
- Record reproducible evidence, severity, and remediation steps.
Runtime protection:
- Inspect inputs, retrieved content, memory, and tool calls.
- Enforce policies before sensitive actions.
- Constrain tool access by user, purpose, data class, and declared task intent.
- Block, redact, require approval, or alert when behavior drifts.
- Monitor failures and feed them back into new test cases.
The key is to design for containment. Assume untrusted content can enter the system. The goal is to make sure it cannot silently become authority, memory, action, or access.
Diagrams to Help


| Boundary | What Can Fail | Control Needed |
|---|---|---|
| Instruction boundary | Untrusted input overrides higher-priority instructions | Prompt hierarchy tests, instruction conflict handling |
| Retrieval boundary | Manipulated content enters context as trusted knowledge | Source validation, retrieval filtering, trust labels |
| Memory boundary | Unsafe content is stored and reused later | Memory write controls, expiry, review, isolation |
| Tool boundary | Agent calls the wrong tool or exceeds intended scope | Least privilege, intent-aware tool gating |
| Action boundary | Model-generated output triggers real-world change | Approval workflows, runtime policy enforcement |
dwaar’s POV
At dwaar, we see the agent harness as one of the most important places to test and enforce security, but not the only one.
Agentic risk shows up in the decisions around the model: what the agent sees, what it remembers, which tools it can access, and what it is allowed to do. That is why testing must go beyond normal application checks.
dwaar’s approach is to red-team agentic workflows before deployment using adversarial prompts as test cases. We test the agent’s responses, tool calls, access boundaries, retrieval behavior, and policy failures. Each issue should produce evidence, severity, and a clear fix path.
The next step is turning those findings into runtime policies.
If testing shows that a support agent can leak customer data, call an internal tool without enough context, or follow malicious instructions inside a retrieved document, that should not remain a PDF finding. It should become an enforceable control: block the action, redact the data, require approval, constrain the tool call, or alert the team.
Agent security becomes useful when it connects testing to enforcement.
The model may be probabilistic, but the controls around it should be intentional, observable, and repeatable. That is where secure agentic systems begin.
Suggested meta title: AI Agent Harness Security: Where Agentic Trust Boundaries Live
Suggested meta description: An AI agent harness turns a model into an operational system. Learn where agentic risks emerge and how to secure instruction, retrieval, memory, tool, and action boundaries.