Monitoring mode records and evaluates every tool call without stopping it, which helps teams learn what the agent actually does before they enforce policy. Guardrails mode applies the verdicts, so deny blocks the action and ask requests user approval. A mature rollout usually starts with monitoring, then moves to guardrails once the rule set is tuned.
Why Monitoring Mode and Guardrails Mode Matter for AI Coding Agents
Monitoring mode and guardrails mode are not just UI labels. They represent two different security postures for autonomous coding agents that can read code, write files, run tools, and trigger side effects. Monitoring mode is observational: it shows how the agent behaves before the organisation trusts it. Guardrails mode is enforcement: it turns policy into runtime decisions that can block or require approval.
That distinction matters because AI coding agents do not follow stable human-like access patterns. Their tool use is dynamic, prompt-driven, and sometimes surprising. Guidance from the OWASP Agentic AI Top 10 and NHI research such as Analysis of Claude Code Security both point to the same problem: if teams assume the agent’s first safe-looking task represents its normal behaviour, they usually discover the risky edge cases later in production.
In practice, many security teams encounter over-permissioned agent actions only after the agent has already touched production data, not through intentional policy design.
How the Two Modes Work in Practice
Monitoring mode is best understood as telemetry plus evaluation. Every tool call, file change, command execution, and external request is logged and scored against policy, but the action still completes. This lets security and platform teams learn what the agent actually does with real prompts, real repositories, and real workflows. It is especially useful for establishing a baseline, tuning allow and deny rules, and identifying where an agent is chaining tools in ways the design team did not expect.
Guardrails mode takes the same policy logic and applies it in-line. A deny verdict stops the action. An ask verdict pauses execution until a user approves or rejects the request. That makes guardrails closer to runtime access control than to observability. For AI coding agents, the policy decision often needs context that static RBAC does not capture: what repository is being modified, whether the action touches secrets, whether the command is in a production environment, and whether the request is part of a known task.
Operationally, mature teams usually combine the two with policy-as-code and short-lived identity. The agent should present workload identity, not just a reusable token, and the policy engine should evaluate each request at runtime. This is where current guidance from NIST AI Risk Management Framework and the CSA MAESTRO agentic AI threat modeling framework becomes practical: measure, then enforce, rather than guessing what the agent will do.
- Use monitoring mode to discover legitimate workflows and high-risk tool sequences.
- Use guardrails mode to enforce task-scoped limits on file writes, shell access, and secret access.
- Prefer ephemeral credentials and runtime decisions over long-lived static tokens.
- Separate developer sandboxing from production-grade approvals.
These controls tend to break down when agents inherit broad repo, cloud, or secret-store access because the policy engine has no meaningful context left to distinguish routine coding from privilege expansion.
Where the Tradeoffs and Edge Cases Show Up
Tighter guardrails often increase friction, so organisations have to balance developer speed against blast-radius reduction. That tradeoff becomes visible when teams move from observation to enforcement and suddenly see approvals, denials, and workflow pauses that were invisible in monitoring mode.
There is no universal standard for how strict the first guardrail set should be, but current guidance suggests starting with high-signal controls: secret exposure, destructive file operations, production environment access, and outbound network actions. This approach is consistent with findings in The State of Non-Human Identity Security, which highlights weak rotation, inadequate monitoring, and over-privilege as recurring attack drivers. It also aligns with the practical lessons from Amazon Q AI Coding Agent Compromised and Replit AI Tool Database Deletion, where agent actions escalated into real operational damage.
Edge cases matter. Monitoring mode can understate risk in environments with low signal density, while guardrails mode can over-block legitimate refactors, dependency updates, or automated remediation. Best practice is evolving toward layered controls: monitor first, enforce second, and keep the policy set narrow enough that human approvers are only pulled in for genuinely high-risk actions.
In tightly coupled CI/CD pipelines, these modes become hardest to operate when one agent session spans code, credentials, and deployment targets, because a single approval decision may cover several different risk domains at once.
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 | Agentic workflows need runtime controls for unpredictable tool use. |
| CSA MAESTRO | MAESTRO maps directly to agent threat modeling and enforcement paths. | |
| NIST AI RMF | AI RMF frames monitor-then-enforce as a risk governance pattern. | |
| OWASP Non-Human Identity Top 10 | NHI-03 | Guardrails rely on ephemeral, well-managed non-human credentials. |
| NIST Zero Trust (SP 800-207) | AC-6 | Zero trust supports least privilege for dynamic agent actions. |
Apply runtime policy checks to each agent action before it can change code or call tools.
Related resources from NHI Mgmt Group
- What do security teams get wrong about AI agent and NHI monitoring?
- How should security teams handle credentials inside AI coding agent sandboxes?
- How should security teams govern AI agent access without relying only on behavioral monitoring?
- How can security and platform teams tell whether AI coding agent rollout is actually controlled?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 27, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org