Before an Agent Executes: Exposure Controls, Approval Records, and MCP Authority
A practical brief on pre-publication controls for coding-agent exposure, approved execution with verifiable records, and MCP credentials and tool authority.
DAILY BRIEF · 2026.10.04 · AGENT SECURITY
Before an Agent Executes: Exposure Controls, Approval Records, and MCP Authority
As AI coding agents read screens, leave logs, and move across repositories and tools, the security center of gravity shifts to the moment before execution. This brief connects information-exposure control, approved execution with evidence, and credential boundaries for MCP connections.
Today’s direction: agent security starts with pre-publication control, not post-execution cleanup
A coding agent can bring browser views, terminal output, issue text, repository files, and results from connected services into one working context. That can remove repetitive work, but it also expands the chance that secrets, customer data, internal addresses, or unfinished work appear in the same path. The point is not to claim that a particular product necessarily exposes information. It is to inspect, before work begins, what the workflow reads and leaves behind through screenshots, logs, copied output, branches, attachments, and external tool calls.
This is an operating memo based on public security and standards material. It does not determine whether any service has had an incident, why one may have occurred, or whether a particular organization is suitable for a tool. Teams need a shared description of what data is read, what actions can execute, and what records confirm the outcome. The focus here is operational sequencing, not legal advice or a regulatory determination.
1. Screens, logs, repositories, and secrets: treat exposure as a pre-publication control
OWASP’s LLM06:2025 Excessive Agency describes the risk that an agent with excessive functionality, permissions, or autonomy can take unintended actions. OWASP’s Agentic AI threats and mitigations material addresses the attack surface and possible controls around agentic systems. Together, they point to a practical distinction: when an agent can read untrusted material and call tools, the ability to read something must not be treated as the authority to share it or change it.
OWASP LLM TOP 10 · AGENCYLLM06:2025 Excessive AgencyExplains how excessive functionality, permissions, and autonomy can lead an agent to unintended actions.
OWASP RESOURCE · AGENTIC AIAgentic AI - Threats and MitigationsA starting point for examining the threat surface and mitigations of agentic AI.
Start with screens and output. A shared screen or a screenshot rarely contains only source code. It can also show a signed-in browser session, terminal environment variables, notification banners, file paths, chat panes, tab titles, or part of an access token. Where an agent can interpret a screen or retain a work record, use a dedicated browser profile with minimal extensions and separate sensitive tabs, notifications, autocomplete, and clipboard access. For work that needs a capture, define the capture area, storage location, readers, and retention period. Prefer the required window or region over a complete desktop.
Logs are not harmless debugging residue. Command arguments, request headers, error bodies, tool inputs, and response fragments may contain tokens, cookies, personal data, or internal identifiers. General logs should retain the minimum signal needed for investigation: a key name, length, hash, or masked fragment rather than a full value. Do not keep conversational context and execution logs together without a defined limit. When reproducing a fault, use synthetic values, a minimized input, and access-controlled evidence instead of pasting production secrets back into a prompt.
A repository is more than code. Sensitive language can enter commit history, branch names, issue templates, CI configuration, examples, and generated output. Before granting an agent repository access, define the working directory and allowed paths, and exclude personal configuration, deployment settings, secret-management files, and download folders by default. Even when write access is needed, make a temporary branch or reviewable patch the default destination. External sharing, default-branch merges, and release creation should remain distinct approval actions.
Keep secrets out of prompt text and treat them as short-lived task credentials. The agent should receive a narrowly scoped token only when it needs one, and the token should be revocable when work ends, approval is withdrawn, or suspicious behavior appears. Establish the response path for a discovered secret before it happens: do not copy the raw value into a conversation or ticket; stop access, determine scope, connect rotation and invalidation to an owner, and preserve only the evidence needed for follow-up. “The agent read it” and “it left the environment” are different questions, but both need evidence that can be checked.
This is not a drag on delivery. It creates an artifact path that can be reviewed before publication. Mark each code suggestion, screenshot, log excerpt, commit, issue, and delivery request by its audience, whether its original content is retained, and whether approval is needed. As automation expands, it becomes safer to make the actions that must never happen explicit in policy and in the available tool list.
2. Execution permissions and audit records: turn approved actions into verifiable flows
The NIST AI Risk Management Framework connects AI risk to organizational management activities. The NIST AI RMF Playbook is a companion resource for translating that framework into practical activities. For agents, the useful operating lens is to manage more than the quality of a model output: manage who allowed an external state change, in what context, and through which tool.
NIST · RISK MANAGEMENTAI Risk Management FrameworkProvides a framework for connecting AI risk with organizational management and decision-making.
NIST · IMPLEMENTATIONNIST AI RMF PlaybookA playbook for moving the AI RMF into concrete organizational activities.
An agent’s authority is too varied to be captured by a single role name. “Developer assistant” can hide repository reads, code edits, test runs, package installation, external API calls, issue creation, and deployment requests—actions with different consequences and reversal costs. Divide them into read, draft, internal write, external write, deletion, and permission change. Make the narrowest level the default. Constrain reads by project and path; keep drafts pre-delivery; and constrain writes again by target, field, count, and time window.
Approval is an execution contract, not a button. Alongside a natural-language summary, an approval view should expose fixed fields for the tool to be called, target system, target list, before-and-after values, attachments, expected side effects, expiry, and retry conditions. Require a new approval when parameters change. Keep large changes, external delivery, irreversible deletion, privilege elevation, and actions tied to money, contracts, or public commitments out of the automatic path. In a Korean organizational setting, clearly separate a developer’s convenience approval, a business owner’s approval, and a security operator’s exception handling so responsibility does not blur.
Least privilege tends to expand over time. An exception granted to solve a temporary problem can become the next task’s default, and a person’s broad account can be copied into an automation identity. Bind every permission to a business purpose, resource scope, allowed action, expiry, issuer, and revocation condition. Use credentials that expire with one task or a short session. Putting a person’s long-lived credential into an agent environment variable or configuration file makes both revocation and attribution harder.
A verifiable execution record is not a matter of retaining more logs. It links the requester, execution identity, policy version, model or workflow version, tool name, approval ID, input sensitivity classification, external job ID, and result-confirmation state under one request ID. It does not place raw tokens, original personal data, or complete screenshots into the ordinary record by default. When a detailed investigation is necessary, open masked material in a separately protected area and record that access as well.
There are two meanings of success. A response that says a call was accepted is different from proof that the target system changed state. After a timeout or connection error, query the external job ID and target state before repeating a write request. If that cannot be confirmed, retain an unverified-result state and open a manual confirmation path. That distinction reduces duplicate creation, duplicate delivery, and repeated updates, while allowing a new operator to reconstruct the work.
3. MCP security: narrow credentials, tool approvals, and execution authority per connection
The Model Context Protocol Authorization specification describes authorization for MCP environments, while the official modelcontextprotocol repository publishes the protocol’s specification and documentation. Together, they establish MCP as common infrastructure for connecting tools and data. A successful connection, however, does not decide whether a particular call is appropriate for a business task.
MCP SPECIFICATION · AUTHORIZATIONAuthorization - Model Context ProtocolA specification for examining authorization flows and delegated authority in MCP environments.
When adding an MCP server, write the call contract before focusing on its name. State the business purpose, calling task identity, required read or write access, resources and fields it may return, prohibited tools, and owner of failure handling. A document-search server might be limited to title and body search in approved folders; an issue server might only create a draft. If its tool list includes write, deletion, or permission changes, allow only the precise action an agent actually needs.
Credentials should not blur the boundary between an MCP client, a server, and the resource owner. One shared, long-lived token across many agents and servers makes it difficult to distinguish who accessed which resource. Prefer short-lived credentials limited to a user or task identity, and explicitly review redirect, callback, and token-transfer paths. Do not put credentials in prompts, source files, ordinary tool inputs, or error messages. Put rotation, revocation, and expiry into the real work path rather than treating them as an afterthought.
Tool approval should be more specific than asking whether a server is trusted. Approve a named tool, target, parameter range, maximum number of calls, and execution window. Even a read tool can have material impact if it performs bulk collection or returns sensitive search results, so limit result counts and time ranges. Attach a single-use approval, short expiry, idempotency key, and target-state confirmation to writes. Keep tool metadata separate from model input so embedded instructions cannot broaden the execution policy or authorization scope.
Recheck execution authority on every call, not only when a connection is created. If a server’s provided tool names, schemas, or permission scope change unexpectedly, do not carry broad authority forward automatically. Hold new tools and expanded inputs for review until they pass policy and the approval flow. If a result returns more files, records, or external links than expected, reduce the next call’s scope or hand it to a person. An agent plan may appear reasonable while an executor still needs to stop actions outside the contract.
For each MCP connection, retain the server ID and version, client identity, safe summary of requested tool and parameters, authorization decision, approver, response size, external-change ID, and final confirmation state. Preserve blocks, denials, expiry, and partial success as distinct states. A block can be evidence that a control worked, rather than proof that automation failed. Conversely, a successful response is not proof that a change completed. That distinction makes it possible to identify impact quickly when a connection must be removed or narrowed.
Operator memo: six checks before the next agent task
- Exposure surface: List the screens, captures, logs, clipboard paths, repositories, and attachments that the task reads or leaves behind.
- Data path: Define masking and original-content handling so sensitive values are not copied into prompts, ordinary logs, issues, or commits.
- Least privilege: Narrow every task identity by resource, tool, action, field, and time window; never pass through a long-lived personal credential.
- Approval contract: Use a single-execution approval that shows the target and before-and-after values for external writes, batches, deletion, and permission changes.
- Execution record: Link request, policy decision, approval, external job ID, and target-state confirmation without recording secret values.
- MCP boundary: Use allowlists by server tool, target, parameter, and call count, with clear expiry and revocation paths.
The best first application is a narrow, read-only task. In a flow that finds titles in an approved document folder and produces an internal draft, deliberately observe token expiry, a policy block, an unexpected tool proposal, a timeout, and an unverified result. Expand repository writes, external delivery, and persistent operation only after that sequence has usable evidence.
A trustworthy agent is not the agent that sees more; it is the one that stops at the boundary
Screen, log, and repository access expand information exposure. Execution permissions expand the ability to make real changes. MCP connections expand delegated tool use. These are not separate problems; they lead to the same pre-publication question. Before work begins, answer what the agent can read, what it can execute, who approves it, and which record confirms the outcome. With those answers fixed, automation becomes repeatable operational work rather than a convenient demonstration.
Sources
Related posts
Read →Related tools