Agent security
Local AI Agent Security: What Runs Locally and What Leaves the Device
Local AI agent security describes where a particular control evaluates an operation; it does not establish the data handling of the whole coding workflow.

Executive summary
Local AI agent security describes where a particular control evaluates an operation; it does not establish the data handling of the whole coding workflow. Trace the coding client, model calls, tools, diagnostics and evidence exports separately. A locally checked command can still intentionally send information to a remote model or service, while a local log can retain sensitive material long after the task ends.
Separate the decision location from the workflow
Begin with the operation you want to protect. A pending file edit may be checked on the developer's machine before the file changes. A remote MCP service may then receive information through another configured call. A hosted agent can execute commands in a remote environment even when the developer starts it from a local interface.
These are different boundaries. Record where each process runs, which identity it uses and which information crosses to the next component. Avoid assigning a privacy property to an entire product from the location of one decision engine.
NIST's zero-trust architecture distinguishes resource authorization from assumptions about network location. Apply that principle to this review: local execution is a fact about a route, while permission to read or disclose a value is a separate decision.
Map five data paths
Use one owned task and write down the following paths. The table is a review worksheet, not a claim that every product has the same architecture.
| Path | Information to identify | Review question |
|---|---|---|
| Coding client to model | Prompts, selected files and tool results | Which configured provider receives which context? |
| Pending-action check | Arguments, task context and policy inputs | Where is the decision made and what does that component retain? |
| Tool to resource | Request content, identity and recipient | Is this specific transfer authorized for the task? |
| Diagnostics | Errors, traces, support bundles and setup output | Can sensitive content appear outside the main result? |
| Evidence and export | Decision records, transcripts and retained artifacts | Who can inspect them, where are copies stored and when do they expire? |
Record unknown paths explicitly. A product diagram can suggest where to inspect, but the deployed settings and actual integration determine the review scope.
Follow a synthetic field through a worked example
Consider a proposed exercise using a disposable repository. The task asks the agent to diagnose a test failure and send a public diagnostic identifier to an owned receiving endpoint. A fixture also contains a synthetic private field that the task does not authorize for transfer.
First inspect whether either value enters the model context. Then inspect the pending tool arguments and the decision available on that route. Finally, inspect the content delivered to the endpoint and retained in diagnostic or evidence records.
The intended comparison changes one material fact, such as the included field or recipient, while leaving the ordinary tool operation recognizable. State the expected allowed and prohibited effects before running it. Do not use a real credential or describe this proposed exercise as a measured Harden result.
An omitted value in the final response proves little about earlier steps. It may have appeared in a model request, an intermediate file or a setup error. Conversely, a local read is not itself evidence of an external disclosure. Keep those observations distinct and tied to their actual destinations.
Review remote tools and cloud environments separately
An MCP connection introduces a service boundary with its own operator, tools and downstream identity. The protocol's security guidance addresses risks at those boundaries. Authentication and token checks do not by themselves decide whether every possible export matches the user's task.
Hosted coding environments add another execution location. Cursor's Cloud Agent documentation describes remote environments containing repositories, dependencies, secrets and startup steps. A control installed on a developer laptop does not establish coverage inside that environment.
For any remote route, identify the effective service account, necessary resources, permitted recipients and retained artifacts. Verify expiry and revocation at the resource rather than assuming closing a local application removes downstream access. Our MCP authorization guide provides a related implementation checklist.
Treat logs as data stores
Logs can be operationally useful and sensitive at the same time. A decision record may include tool arguments, target paths or a diagnostic fragment. A support bundle can create another copy. An exported record may be subject to different access and retention controls from the original local store.
Collect what an authorized investigator needs while minimizing unnecessary payloads. Preserve correlation references, decision states and scope without making a complete secret-bearing transcript the default evidence format. Verify who can read local files, backups and exported copies.
Test the evidence path with synthetic markers too. If redaction is expected, inspect the stored and exported content instead of relying on a UI label. Record where inspection was unavailable; absence of access is not evidence that no copy exists.
For retained records, name the deletion owner and the copies that owner can actually remove. A local file, synchronized backup and exported support attachment can have different lifetimes. Rehearse the approved retention process with a synthetic marker, then record any copy whose deletion or access restrictions could not be verified.
Ask precise questions about Harden
Harden evaluates supported pending coding-agent calls using relevant task context and policy. Our research and evidence describes the local evaluation approach and its stated model requirements. Apply that description to the documented configuration rather than extending it to every agent tool or workflow transfer.
For the intended deployment, identify the actual integration, decision inputs, model path, diagnostics and evidence handling. Keep unsupported routes visible. A local decision does not remove the coding agent's separate provider calls or a tool's legitimate network activity.
Bring that data-flow map to Control for a scoped evaluation. Keep secret storage, recipient policy and downstream authorization under their respective owners; the map should show how those controls work together.
FAQs
Does a local security model mean source code never leaves the device?
No. A local security decision and the coding agent's model or tool calls are separate paths. Inspect the configured provider requests, remote tools, diagnostics and exports. Make any privacy statement about the specific data and route verified, rather than the location of one component.
Is a cloud security check automatically unsuitable?
Evaluate the information it receives, the approved processing arrangement and the task's requirements. A remote check creates a data path that needs review; local checking has its own installation, access and retention questions. Compare the actual architecture and controls instead of treating either location as a universal verdict.
Why inspect diagnostics if the main request is restricted?
An error, trace or support attachment can contain information absent from the intended request. Review those outputs as separate data paths with their own recipients and retained copies. Use synthetic content to verify expected minimization without exposing a real secret during the check.
Can an approved MCP server receive every project file?
Connection approval is not blanket authority to export arbitrary content. Review the server's operator, tools, downstream identity and intended task. Verify the specific file or value, recipient and effect; retain resource authorization and appropriate content restrictions at their actual boundaries.
What should we save from a data-flow review?
Save the task, source, executing identity, operation, recipient, deployed configuration, observed decision and delivered effect. Include diagnostic and evidence destinations, retention owners and unknown routes. That record lets later reviewers distinguish a verified boundary from an architectural assumption.


