Join our Newsletter — 33% off our NHI Course

How should security teams build AI agents that use MCP tools without creating a brittle workflow layer?

Security teams should treat agent workflows as governed application logic, not ad hoc prompts. The practical goal is to separate planning, tool use, and execution, then enforce authentication, authorization, retries, and traceability at each step. That reduces hidden context drift and makes it easier to audit which tools were called, why they were called, and what data moved between steps.

Why This Matters for Security Teams

MCP can make agent development faster, but it also turns tool access into a security boundary that must be designed, not assumed. When an AI agent can query systems, move data, and trigger actions, the workflow layer becomes part of the attack surface. The risk is not only prompt injection. It is also overbroad tool permissioning, secret sprawl, and weak step-level traceability, all of which appear in current guidance on agentic systems from the OWASP Top 10 for Agentic Applications 2026 and NIST AI governance materials.

NHI Management Group research on OWASP Agentic Applications Top 10 shows why this matters in practice: once an agent can chain tools, the control problem shifts from single API calls to the whole sequence of planning, authorization, and execution. That is where brittle designs fail, because they encode assumptions about what the agent will do rather than what it is allowed to do at runtime. Security teams should treat the MCP layer as governed application logic, not a thin prompt wrapper.

In practice, many security teams discover tool abuse only after an agent has already combined several benign actions into one harmful workflow.

How It Works in Practice

The most resilient pattern is to split the agent into distinct control planes: planning, tool selection, policy enforcement, and execution. The agent can propose actions, but the workflow layer should decide whether a tool call is allowed, what data can be passed, and whether the step can proceed. That aligns with the emerging direction in NIST AI Risk Management Framework and the agent-specific threat modeling approach in CSA MAESTRO agentic AI threat modeling framework.

A practical MCP build pattern usually includes:

  • Workload identity for the agent runtime, so the system authenticates what the agent is rather than trusting a long-lived shared credential.
  • Per-tool authorization at request time, not a static allowlist baked into the prompt or client.
  • Short-lived, task-scoped secrets that expire automatically after the workflow step completes.
  • Structured tool contracts, so the workflow layer can validate inputs and outputs before data reaches the next step.
  • Centralized logging of tool name, policy decision, correlation ID, and downstream side effects.

This is where MCP teams should think in terms of just-in-time access and workload identity, similar to SPIFFE-style identity patterns, rather than embedding credentials inside the agent loop. The concern is not only theft of a token, but misuse of a valid token by an agent that is making new decisions on the fly. NHI Management Group has documented how secret leakage and weak scoping combine in real deployments in the Analysis of Claude Code Security and the Moltbook AI agent keys breach. The key design move is to make every tool call independently authorizable, because the agent’s next step cannot be assumed from its last step.

These controls tend to break down when teams let the agent call tools directly from a shared runtime with static secrets and no policy checkpoint between steps.

Common Variations and Edge Cases

Tighter control often increases workflow latency and implementation overhead, so organisations have to balance agent autonomy against operational friction. That tradeoff becomes more visible when multiple MCP servers, human approvals, and cross-domain data sources are involved. Current guidance suggests the safest pattern is not to remove autonomy entirely, but to constrain it with step-level policies and revocation paths.

One common edge case is when an agent needs to complete a multi-step task across systems with different trust levels. In that environment, static RBAC is usually too coarse because it cannot express context, sequence, or purpose. Another is delegated operations, where the agent acts on behalf of a user. In those cases, the workflow should preserve user intent and separate user rights from agent runtime rights, because the agent may have tool access the user does not. There is no universal standard for this yet, but best practice is evolving toward context-aware authorization and explicit action review for high-risk steps.

Security teams should also watch for brittle designs that depend on one orchestration path. If the agent fails over to a backup model, a backup tool, or a different MCP server, the control model must remain intact. That is why agent governance should be policy-as-code, not hidden in prompt instructions or one-off wrappers. The most relevant threat patterns are reflected in the OWASP NHI Top 10 and the broader agent-risk framing from the OWASP Agentic AI Top 10.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10, CSA MAESTRO and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST AI RMF and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Agentic AI Top 10 A2 Tool abuse and workflow chaining are core agentic application risks.
CSA MAESTRO TA-2 MAESTRO addresses threat modeling for agentic workflows and tool mediation.
NIST AI RMF GOVERN The question hinges on governance, accountability, and traceability for AI agents.
OWASP Non-Human Identity Top 10 NHI-03 MCP tool access depends on strong identity and secret handling for non-human workloads.
NIST Zero Trust (SP 800-207) AC-6 Zero trust principles fit per-request authorization for autonomous tool use.

Verify each tool invocation at runtime and deny access unless the context is explicitly trusted.