TL;DR: Claude Code can read files, run shell commands, call APIs, and trigger workflows, but its protections are mostly model-level rather than runtime enforcement, according to Akto. That leaves engineering teams exposed to prompt injection, tool abuse, shadow deployments, and over-permissioned sessions that IAM and AppSec must govern more tightly.
At a glance
What this is: This is an analysis of Claude Code security that finds model-level guardrails are not enough when the agent has live access to files, commands, APIs, and workflows.
Why it matters: It matters because teams governing agentic AI need runtime controls, scoped permissions, and auditability, not just safer outputs from the model itself.
Context
Claude Code security is really a question of control boundary, not model quality. Once an AI coding agent can read repositories, execute shell commands, invoke APIs, and trigger CI/CD workflows, the risk shifts from bad answers to bad actions.
That creates a direct governance problem for engineering, AppSec, and IAM teams: model-level protections can reduce some unsafe outputs, but they do not reliably constrain what happens in a live session. The operational question is who can authorise the agent, what it can touch, and how runtime behaviour is monitored when the agent is acting inside production-adjacent systems.
Key questions
Q: What breaks when AI agents are given broad inherited permissions?
A: Broad inherited permissions break the assumption that access is tied to a narrow business need. The result is larger blast radius, weaker accountability, and faster propagation of mistakes or abuse across connected systems. A single compromised or misconfigured agent can then touch far more data and workflows than the original task required.
Q: Why do agentic workflows increase the risk of indirect prompt injection?
A: Because they blend untrusted content and trusted instructions inside the same execution path. If logs, files, binaries, or retrieved documents can influence the model before the harness checks them, attacker-authored content can steer tool use, which turns a content issue into an access-control issue.
Q: How do security teams know if runtime controls are actually working for AI workloads?
A: They should be able to reconstruct a complete sequence from prompt ingestion to process activity to identity use to data access. If a tool only produces isolated alerts, it is not proving runtime control. Effective monitoring should preserve the execution chain even if the pod is rescheduled or the workload is short-lived.
Q: How should IAM and AppSec teams govern developer AI agents in production-adjacent environments?
A: They should treat the agent as a privileged non-human actor with narrowly scoped access, just like any other high-risk service identity. That means separating environments, limiting tool access, requiring approvals for exceptional actions, and tying every session to observable ownership. The goal is to govern delegated machine action, not just model output.
Technical breakdown
Model-level guardrails versus runtime enforcement
Claude Code’s protections are largely reasoning and filtering layers applied to what the model sees and outputs. That is useful for catching obvious malicious instructions, unsafe patterns, or exposed secrets during analysis, but it does not equal runtime control. A model can be cautious while the surrounding session still has broad permissions, access to sensitive files, and the ability to call tools. In practice, the security boundary is enforced by the environment, not by the model’s confidence score.
Practical implication: Treat model output as advisory and move enforcement into the agent runtime, permission layer, and audit trail.
Why agentic workflows create a wider attack surface
An agentic coding tool is not a passive assistant. It can chain actions across files, commands, APIs, and CI/CD pipelines, which means a single compromised prompt can become a multi-step execution path. Prompt injection, tool misuse, and unexpected network calls are different expressions of the same problem: the agent is being steered at execution time. Once the agent can influence downstream systems, security is no longer about identifying bad text, but about constraining what the text can cause.
Practical implication: Scope tools, data, and network access so the agent cannot translate a single prompt into broad operational change.
Shadow AI and sessionless behaviour weaken governance
Claude Code’s local and session-based use creates visibility gaps when teams allow developers to run it near sensitive environments without central oversight. The article’s core limitation is not just lack of memory across sessions, but lack of durable governance signals: no native cross-session pattern detection, limited visibility into what was accessed, and no consistent way to prove control over use. That makes shadow deployments especially risky because the organisation may not even know which sessions touched production-adjacent data.
Practical implication: Require inventory, logging, and approval controls for agent sessions that can reach sensitive code or infrastructure.
Threat narrative
Attacker objective: The attacker wants to turn a trusted coding agent into an execution path for data exposure, unsafe actions, or unauthorized environment changes.
- Entry occurs when a compromised prompt, malicious file, or injected instruction reaches the agent during a live Claude Code session.
- Credential or tool abuse follows when the agent uses its granted access to read files, execute commands, or call APIs in ways the user did not intend.
- Impact appears when the agent leaks data, triggers an unsafe workflow, or alters production-adjacent systems before a human reviewer can intervene.
Breaches seen in the wild
- Nx s1ngularity attack 2025: Attackers stole Nx's npm token via a GitHub Actions flaw and shipped malware that stole 2,349 secrets and abused developers' AI CLIs.
- tj-actions/changed-files compromise 2025: A stolen bot token let attackers poison tj-actions/changed-files so pipelines printed their CI/CD secrets to public logs (CVE-2025-30066).
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Runtime control is the real governance boundary for agentic coding tools. A model that can reason about unsafe code is not the same as a system that can stop an unsafe action. The operational question is where enforcement happens when the agent can write, execute, and call tools in the same session. For practitioners, model evaluation is useful, but runtime authorisation is the control that changes risk.
Claude Code exposes a familiar identity problem in a new form: delegated machine action without durable oversight. When a coding agent can act through a developer session, the security concern is not just code quality but delegated authority. That makes this an IAM and PAM issue as much as an AI issue, because the session boundary becomes the boundary of trust. The practitioner conclusion is to govern the agent like a privileged non-human actor, not like a smarter autocomplete.
Shadow AI is now a governance failure mode, not just an inventory problem. The article’s warning about local use, missing audit trails, and cross-session blindness shows that discovery alone is insufficient if an agent can operate against sensitive code or infrastructure outside central control. This is where agentic AI security and NHI governance intersect: if the agent can act, it needs ownership, scoping, and revocation logic. Practitioners should assume unmanaged sessions are already part of the attack surface.
Prompt injection becomes more dangerous when it can translate directly into tool execution. The article makes clear that the risk is not the malicious instruction itself but the downstream command, file access, or network call that the instruction induces. That is why runtime guardrails, tool allowlists, and environment separation matter more than content filters alone. For the field, the lesson is that AI safety controls must be paired with access controls or they remain advisory.
Agentic AI security is moving toward blast-radius control, not model purity. The meaningful question is how much damage a compromised or over-permissioned session can do before it is contained. That is a governance shift: teams need to define safe operating envelopes, not just ask whether the model detected the unsafe request. The practitioner takeaway is to design for limited blast radius first, then add reasoning-based review on top.
From our research library:
- 69% of security leaders agree identity management must fundamentally shift to address agentic AI systems, according to the 2026 Infrastructure Identity Survey.
- Read next: Agentic AI Identity Guide
What this signals
Runtime enforcement, not model reassurance, will decide whether agentic coding tools are safe to scale. Teams that stop at prompt filtering or code-review reasoning will miss the point: the agent’s authority is what needs to be bounded. The governance question is whether a session can actually do damage outside its intended scope.
Claude Code-style workflows turn privileged developer sessions into NHI governance problems. Once an agent can act on repositories, commands, and downstream systems, it behaves like a non-human actor that needs ownership, scoping, and revocation logic. That makes agent identity, tool access, and session isolation part of the control plane, not an afterthought.
69% of security leaders agree identity management must fundamentally shift to address agentic AI systems, according to the 2026 Infrastructure Identity Survey. The article is a practical example of why that shift is overdue: runtime permissions, auditability, and environment separation now matter as much as model safety. Teams should expect agent governance to move closer to privileged identity control than to traditional application hardening.
For practitioners
- Restrict high-risk permissions by default Treat dangerous-skip-permissions style execution as a privileged exception, not a normal workflow. Limit it to tightly controlled environments and require auditable approval for any session that can write code, run commands, or reach production-adjacent systems.
- Define tool allowlists before deployment Specify exactly which files, commands, APIs, and workflows the agent may use, then block everything else. The goal is to stop the agent from turning one prompt into uncontrolled execution across the development stack.
- Separate development and production access Keep agent runtime environments away from systems that can modify production infrastructure or expose sensitive data. Use separate accounts, separate network paths, and separate approval rules so a coding assistant cannot inherit broader trust than the task requires.
- Capture agent inputs and tool calls Log prompts, outputs, tool invocations, and environment access so security teams can reconstruct what the agent touched. Without that evidence, investigations cannot distinguish a safe session from a compromised one.
- Run runtime red teaming on agent workflows Test malicious file content, injected instructions, and tool misuse scenarios against the full workflow, not just the model prompt. Use those tests to identify where the agent can be steered into unwanted commands or data access.
Key takeaways
- Claude Code security shows that model-level guardrails can reduce unsafe outputs without stopping unsafe actions in a live session.
- The key risk is not only prompt injection but the ability of a compromised agent to use tools, touch files, and affect workflows.
- Effective governance depends on runtime permissions, audit trails, and environment separation that limit the agent’s blast radius.
Key terms
- Runtime Guardrail: A control applied while an AI agent is operating, not just during configuration or review. Guardrails can block dangerous tool calls, require approval for sensitive actions, or stop data leakage before it reaches systems or users.
- Tool allowlist: An approved list of systems, APIs, or functions that an agent may use. It reduces the agent's blast radius by preventing unrestricted tool discovery and cross-environment access, which are common ways agentic workflows move from helpful automation into operational risk.
- Shadow AI: AI agents, copilots, or connected tools operating without full visibility or governance from security teams. Shadow AI becomes an identity problem when those systems authenticate with unmanaged tokens, service accounts, or OAuth apps that can reach production resources.
- Blast Radius: The potential scope of damage if a specific credential or identity is compromised. Identities with broad permissions have a larger blast radius and represent a higher priority for least-privilege enforcement and security controls.
Deepen your knowledge
NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, agentic AI identity, machine identity security, IAM, and secrets management. It helps practitioners translate identity control into safer delegated machine action across real programmes.
Published by the NHIMG editorial team on August 2, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org