Agent security
What Traditional Security Tools Miss About AI Coding Agents
AI coding agents can perform valid operations that are wrong for the task they were given.

Executive summary
AI coding agents can perform valid operations that are wrong for the task they were given. Existing security tools still protect code, identities, devices and data, but no team should assume those protections establish the agent's authority for every action. The useful question is where the authorized task is checked against the operation that will actually run.
A valid command can still be the wrong action
Imagine a developer asking an agent to investigate a staging problem. The agent finds a valid deployment command, uses a genuine credential and selects production by mistake. There may be no malicious executable, vulnerable code change or stolen identity involved.
The problem is the relationship between the request and the operation. The tool may be approved. The identity may have permission. The task still did not authorize a production change.
This hypothetical example does not establish that existing tools are ineffective. It shows why their responsibilities need to be explicit when an agent can move from reading information to changing systems.
Keep the security layers and their jobs
Layer | Useful question it answers | Additional question to evaluate |
|---|---|---|
Code scanning | Does the submitted code contain a detectable weakness? | Was the agent authorized to deploy or transmit something while creating it? |
Dependency controls | Is this package or component acceptable under policy? | Who authorized installing it in this environment? |
Identity and access | Which resources can this principal reach? | Is this reachable action part of the current task? |
Sandbox and network controls | Which effects can occur within this execution boundary? | Can an allowed destination receive the wrong information? |
Endpoint protection | Is host activity suspicious under its detection/control model? | Does a legitimate tool operation exceed the agent's task? |
Data protection | Does a recognized data flow violate a configured rule? | What context determines the legitimacy of this transfer? |
These are evaluation questions, not universal capability limits. Products differ, and an enterprise may already have controls addressing some of them. Inspect the actual configuration and evidence before introducing another product.
Why the agent changes the operating model
A coding agent reads material while deciding what to do next. That material can include repository files, issue comments, documentation, tool output and configuration. Some of it is useful information. Some may be mistaken or hostile.
The organization needs to preserve a distinction between information and authority. An issue comment can describe a failing test. It should not acquire permission to disclose a credential just because the agent read it during an authorized task.
InjecAgent studies a different failure path from a vulnerable code change: instructions in external content can induce an agent to misuse a tool it already has. The implication for our architecture is to trace the action from the developer's task to the receiving system. The study's bounded, largely single-turn experiments are not evidence that every current coding agent will behave the same way.
Add the task-to-action check where it is missing
A pre-execution control can evaluate a proposed supported operation before the tool runs. The pending command or tool arguments make the effect more concrete than a general prompt alone.
For the staging example, the review should connect the intended environment, resolved target and active identity. For a log upload, it should connect the approved recipient, actual destination and information being sent.
That control also needs limits. If it cannot see the relevant identity or the operation bypasses its integration, the organization must account for the uncovered path. Adding a monitor without a coverage map can create a stronger impression of protection than the evidence supports.
What Harden contributes to this model
Our published research describes checks on supported tool calls before execution. Our published examples examine whether an action remains consistent with developer intent and earlier session context.
The point is to add a decision boundary around covered agent actions while keeping code scanning, credentials, isolation and response controls in place. Do not interpret a successful action check as proof that generated software is free of vulnerabilities or that an endpoint has no other attack paths.
Find the gap before choosing the tool
Assign the handoffs around one operation
For the hypothetical staging investigation, the identity owner should explain why the workflow can reach each environment. The platform owner should identify the deployment endpoint and any infrastructure boundary. The agent-workflow owner should explain where the proposed command is checked against the task. An incident owner should know where to look if a change still occurs.
This exercise may reveal that a configuration change is enough. A staging identity with no production permissions can close one route without introducing a new product. Another operation may need a finer distinction: the identity legitimately reaches an internal collaboration service, but a particular document should not be posted to a broad channel.
Write down the remaining question after each control has done its job. If the unanswered question is whether a pending supported call fits the authorized task, that is a concrete place to evaluate Harden's pre-execution approach. If the problem is a vulnerable dependency or a missing recovery process, assign it to the relevant control owner instead.
The handoff should also name who handles an unclear result. An alert that every team assumes someone else will investigate is not an operating process. Keep the proposed operation, observed effect and response responsibility together, while limiting access to sensitive investigation material.
Take one workflow your developers already use. Write down the sequence from task assignment to repository access, dependency installation, testing and deployment. For each consequential operation, name the system that constrains it and the evidence available afterward.
Then ask a colleague to change one material fact: the destination, account, environment or source of the instruction. Which control detects or blocks the changed operation? Which merely records it? Which never sees it?
The resulting map is more useful than a list of security product categories. It shows where an existing control needs configuration, where a new boundary is justified and where an operational process still matters. Teams evaluating the pre-execution portion can start with Harden and a supported workflow from that map.
FAQs
Can static code analysis secure an agent's whole session?
Static analysis evaluates code according to its detection model. An agent session also includes operations such as installing software and transmitting information. Review which of those effects your tooling actually observes. A clean code result should not be used as evidence that every action taken while producing the code was authorized.
Why is least privilege still important with action checks?
Least privilege reduces what the workflow can affect. An additional action check evaluates operations within its supported path and available context. Keeping access narrow reduces the consequences of a missed decision or uncovered route. The two controls should have explicit responsibilities rather than being treated as substitutes.
Does an endpoint alert prove an action was prevented?
No. Examine the alert's meaning, timing and associated operation. It may indicate a detection, an attempted action or an enforced block, depending on the product and configuration. Check the target system and decision record before describing the result as prevention. Preserve that distinction in management reporting.
Should an enterprise replace its existing security stack?
Start by reviewing the configured stack and the actual workflow. Existing tools may already address some of the risks. Keep the controls that protect code, dependencies, identities, infrastructure and recovery, then evaluate any remaining task-to-action gap. Replacement should follow evidence about a specific responsibility, not a new category name.
Where does Harden belong in that stack?
Our published research describes checks before supported coding-agent calls execute, using intent and context. Evaluate that boundary where it serves your workflow. Confirm the integration, inputs and possible interventions, while keeping the other layers responsible for their own security jobs and documenting paths outside the tested scope.


