All posts

    Agent security

    How Does AI Agent Security Work at Runtime? A Guide to Pre-Execution Security

    AI agent security at runtime checks what an agent is about to do while it works.

    Minimal Harden editorial diagram: ACTION, CHECK, EXECUTE. Headline: Before the Agent Acts. Supporting text: Runtime checks for coding agents.

    Executive summary

    AI agent security at runtime checks what an agent is about to do while it works. A pre-execution control sits before a supported command, file operation or tool call and evaluates the proposed action against the task and applicable policy. Its value depends on the path it covers, the context it can inspect and whether an unsafe action can actually be stopped before it takes effect.

    The useful checkpoint is a proposed action

    A developer asks a coding agent to prepare a staging release. The agent reads the repository, runs tests and chooses a deployment command. Before that command runs, someone needs to answer a specific question: will it change staging, as requested, or production?

    That is a different question from whether the generated code contains a vulnerability. The command could be valid, the credentials genuine and the deployment tool approved, while the selected environment is wrong.

    Pre-execution security evaluates that concrete operation. It does not need to predict every sentence the model will generate. It needs a reliable place between the agent choosing an operation and the tool carrying it out.

    The staging example is hypothetical. It illustrates the boundary an enterprise should evaluate, not a claim that any particular installation protects every deployment path.

    What should the check examine?

    Start with the operation, its arguments and the resource it will affect. Then connect those facts to the task. A useful review asks which identity is active, where data will go and which source authorized the action.

    Question

    Staging-release example

    What did the developer authorize?

    Prepare or deploy to staging

    What will the pending tool do?

    Submit a deployment request

    Which target will receive it?

    The environment resolved from arguments and configuration

    Which identity supplies authority?

    The active deployment account or credential

    Has the task changed?

    Only an authorized instruction can expand its scope

    Reading a runbook is not the same as receiving new authorization. A tool response can explain how to deploy; it cannot grant permission to deploy to a different environment. This distinction matters when external material contains misleading instructions.

    Context also has limits. A monitor that cannot see the selected account, resolved path or relevant earlier instruction may lack the information needed for a confident decision. Ask what it does in that situation. An unexplained default is part of the security boundary.

    Runtime protection has several layers

    Permissions decide which operations an identity can attempt. A sandbox limits the files, processes or network destinations reachable from a particular execution environment. A pre-execution check examines a pending operation on a covered path. Logs preserve evidence for later review.

    These jobs overlap, but they are not interchangeable. A narrow credential can reduce the consequences of a mistake. A sandbox can contain local activity. Neither should be assumed to establish that every reachable operation matches the developer's current task.

    Native coding-agent controls matter too. Claude Code documents permissions and sandboxing. Enterprises should configure those controls and then test any additional enforcement layer against the actual routes developers use.

    Allowing, redacting and blocking mean different things

    An allowed call proceeds. A blocked call does not execute on the enforced path. A redacted call proceeds with a supported modification that removes sensitive material while preserving legitimate work.

    Redaction is not always possible. Removing a token from a diagnostic note may leave the note useful. Removing a credential needed for authentication may make a request invalid. A system should not silently strip arbitrary content and assume the remaining operation is safe.

    Recording a decision is another responsibility. It helps an investigator understand what was proposed, what decision was made and which policy or evidence informed it. Logging after an action has happened does not undo that action.

    Where Harden fits

    Our published research describes evaluating supported tool calls before execution using the proposed action, developer intent and session context. Our examples include distinguishing an authorized staging operation from an unauthorized production operation and an internal log attachment from an external transfer.

    For an enterprise evaluation, those examples suggest a practical starting point: choose a real workflow, identify its legitimate destination, and compare the evidence for an allowed operation with the evidence for a changed destination. Confirm the supported integration and tool path before treating the result as coverage for a wider environment.

    Make the boundary observable

    Follow one decision through to its effect

    In the staging example, begin with a disposable project and an identity that has only the access needed for the exercise. Save the authorized task, then inspect the proposed deployment target before allowing any test operation. Change only the destination for the prohibited variation. That makes the reason for the expected decision easier to examine.

    Keep three records separate: what the agent proposed, what the control decided and what the tool actually did. An allow decision followed by a tool error is not a completed deployment. A block message without a check of the target system is incomplete evidence about the final effect. Use the target system's own harmless test record where available.

    After a legitimate scope change, capture the new authorization and repeat the relevant case. The purpose is to verify that the boundary can distinguish an approved change from a misleading instruction. This is a suggested evaluation method, not a claim that Harden has run your workflow or achieved a particular result.

    A useful pilot records the pending action, resolved target, expected result, observed result and evidence location. Use harmless test resources and synthetic data. Keep a legitimate operation beside the unsafe variation so the team can see whether protection preserves useful work.

    Also check an alternate route to the same effect. If the covered terminal command can be replaced by an uncovered API client, the organization needs another control or an explicit restriction. A successful demonstration on one path should lead to a coverage map, not a claim of universal protection.

    Teams evaluating this workflow can create a Harden account and scope a pilot around the supported calls they need to protect. Account creation is the start of that evaluation; installation, configuration and verification still need to happen.

    FAQs

    Is runtime security the same as checking a prompt?

    No. A prompt check examines information entering a model or workflow. An action check evaluates a proposed operation, such as a tool call with a selected destination. Both can be useful, but a prompt result alone does not demonstrate that a later command stayed within the authorized task.

    Does a sandbox remove the need for action checks?

    A sandbox constrains effects within its configured boundary. A team should still examine whether an operation allowed inside that boundary is appropriate for the task. For example, access to an approved service does not settle which information may be sent to a particular recipient through that service.

    Can logging stop an unsafe tool call?

    Logging by itself records activity. Prevention requires an enforced checkpoint before the relevant effect occurs. During an evaluation, ask separately whether a decision was recorded, whether enforcement was enabled and whether the operation reached the target. A useful investigation record should not be described as a prevented incident without that evidence.

    When should an action be redacted instead of blocked?

    Consider redaction when a supported field can be changed without defeating the authorized operation. Removing sensitive text from a diagnostic attachment may be appropriate; changing an authentication value may simply break the request. Verify the modified operation and its destination rather than treating every successful edit as a security success.

    What should an enterprise verify before adopting Harden?

    Confirm the supported agent and integration path, the context available to the check and the operations that can be affected. Bring a legitimate workflow and a controlled unsafe variation. Review the resulting evidence and uncovered routes before extending conclusions to other teams, tools or environments.