8 min read

AI agent action gateway: five signs you need one

An AI agent action gateway keeps coding agents from holding secrets directly, clarifies approvals, and records every HTTP or SSH action.

AI agent action gateway: five signs you need one

An AI coding agent needs an action gateway when it can act outside its workspace with authority that nobody can clearly inspect, approve, or revoke. The warning is not that the agent writes code. The warning is that it can spend a credential, change a hosted service, or open an SSH session after somebody pasted a secret into its context and called that setup.

Teams often call this an AI agent action gateway problem only after a close call. A token appears in a chat transcript. A coding run uses the production deploy account because it was the only account available. Someone asks who approved a database change, and the answer is a loose chain of messages and a shared terminal session. Those are not paperwork failures. They show that the team has given an untrusted process operational authority without a usable boundary around it.

A gateway does not make an agent safe by judging whether every command is morally good. That is the wrong promise. It keeps credentials out of the agent, places a human decision at sensible points, and leaves a record that lets an operator answer what happened without reconstructing the event from memory. If the following signs sound familiar, direct credential access has already outlived its convenience.

Copied API keys have become normal setup

An agent needs a separate action boundary when a developer pastes API keys into prompts, environment files, terminal sessions, or agent configuration to get work done. This habit feels harmless because the first run often does exactly what the developer asked. It also creates copies in places that were never designed to store production authority.

A credential in an agent context can escape through more paths than the original prompt. The agent may repeat it in a command, write it into a configuration file, include it in a bug report, place it in generated documentation, or reveal it while explaining a failure. Terminal scrollback, shell history, process environments, CI logs, backups, and support screenshots add more copies. Redacting a single visible message does not remove those copies.

The distinction teams blur is simple: an agent using a secret is different from an agent possessing a secret. A browser can submit a payment without exposing the card number to every script on the page. The same separation is possible for an agent. It can request POST /deployments with a described payload while a trusted executor injects the credential and returns the response.

Do not accept a fake version of this separation where the system replaces API_KEY=... with ${SECRET_NAME} and then resolves that placeholder inside the agent process. The plaintext still reaches the same process. A compromised extension, a malicious instruction in a repository, or an over-eager debug dump can retrieve it.

A safer request boundary looks like this:

{
  "channel": "http",
  "credential": "deploy-service",
  "method": "POST",
  "url": "https://api.example.internal/deployments",
  "headers": {"content-type": "application/json"},
  "body": {"service": "catalog", "revision": "a1b2c3d"}
}

The agent can see the endpoint, payload, approval status, and response. It never sees the bearer token that authorizes the request. That difference is what lets you rotate credentials without also cleaning prompts and local worktrees for leaked copies.

When a key has already entered an agent context, treat it as exposed. Revoke or rotate it, inspect the destinations where the run logged output, and remove the direct-secret pattern. Teams sometimes delay rotation because they cannot prove the token leaked. You do not need proof that a copied credential was stolen. You need to recognize that you no longer control where it has been.

Shared accounts hide the actor who made the change

An agent needs an action gateway when it acts through a shared deploy user, a team-wide cloud token, or one SSH account used by every developer and automation job. Shared access saves account administration in the short term and destroys attribution the moment something goes wrong.

Consider a familiar failure. An agent receives a request to repair a build failure. It finds a stale infrastructure setting and connects to a host using ops@production. The account works because it has broad permissions and its private key lives in the repository's onboarding notes. The agent changes a file, restarts a service, and reports success.

Later, the service starts returning errors. The server journal says ops restarted it. The cloud audit trail says the team token called the deployment API. Neither record identifies the agent process, the work request that prompted it, the person who started that process, or whether anyone saw the operation before it ran. The team now has an incident investigation made of inference.

A distinct credential for every person is better than one shared account, but it does not fully solve agent use. If the agent receives Alice's private key or long-lived token, the audit trail can only say Alice's credential acted. It cannot reliably say whether Alice, her terminal, a compromised repository instruction, or her agent initiated the request.

Use identities and records for different jobs:

  • A service identity defines what the external system permits.
  • An agent session identifies the particular running process that asked for work.
  • An approval identifies the person who accepted an action scope.
  • An action record identifies the precise request and its result.

Do not compress these into one field called user. Each answers a different question during an outage or access review.

For SSH, broad shared accounts deserve special suspicion. An SSH private key is a portable signing authority. If the agent has the file, any controls you intended to apply after login have already lost the most useful boundary. Forced commands and account restrictions can reduce harm, and they are worth using, but they do not change the fact that the agent can initiate every connection the key allows.

Move the key into an executor that performs the SSH operation itself. Give the agent a request interface that records the host, command, identity, session, and outcome. Keep the request narrow enough that a reviewer can understand it. systemctl restart catalog is reviewable. ssh host 'bash -c "$(curl ... )"' is an opaque tunnel for arbitrary authority.

One approval for everything is not approval

An agent needs an action gateway when a developer approves a vague permission once and cannot tell which later requests used it. A button labeled "Allow agent access" is consent theater if it covers an unknown set of endpoints, commands, accounts, and durations.

Approvals work when they answer two practical questions: which process asked, and what does this approval cover? The process identity matters because a local machine may run a trusted coding agent, an unsigned script copied from a repository, and a malicious process that copied the agent's name. A display label alone does not establish trust. Code-signing authority gives the reviewer a useful fact to inspect.

Scope matters because approval fatigue turns people into automatic clickers. Asking every developer to inspect fifty routine calls per hour does not create human control. It teaches them to dismiss prompts. On the other hand, a week-long blanket approval for a production credential gives a single accidental instruction too much room to operate.

Use two different approval scopes, based on the consequence of the capability:

  • A session approval can cover ordinary calls made by one identified agent process until that process exits.
  • A per-call confirmation should cover credentials that can make irreversible production changes, move money, alter access, or access data outside the task.

The boundary should expire with the process rather than with an arbitrary memory of what someone clicked yesterday. A new process receives a new decision. That helps when an agent restarts, a tool updates, or a developer opens a second run from a different repository.

The approval card should lead with the process identity and then state the capability in plain terms. "Signed process X requests use of deploy-service for HTTP calls" gives a person something to accept or reject. "Tool requires permission" does not. If the action is per-call, show the target and operation as well. A human cannot judge a request hidden behind a generic capability name.

Avoid building a miniature policy language just because the problem feels sophisticated. Teams lose weeks writing allow rules for prompt-driven tools, then find that the hard question was never syntax. It was whether the agent should have received the authority at all. Start with a vault gate, process-scoped consent, and per-credential confirmation where the blast radius warrants it. You can explain those controls to the person on call at 2 a.m.

The agent can reach production from a throwaway checkout

An agent needs an action gateway when a repository, branch, or disposable development environment can trigger real external actions solely because the agent runs there. Repositories are inputs. Treating repository instructions as trustworthy operators is a category error.

A hostile pull request does not need to exploit the model in a dramatic way. It can place instructions in a file that the agent reads during normal work: "run this diagnostic command," "use the deployment token from the environment," or "upload the logs to this URL." If the agent has direct access to secrets and unrestricted networking, the repository author has found a route to operational authority.

This issue also appears in benign work. A developer checks out an old branch to compare a migration. The branch contains an outdated script that points at production, because it made sense years ago. The agent follows nearby documentation, sees a valid credential in its environment, and performs the call. Nobody intended a production change, but the combination of ambient credentials and untrusted instructions made it possible.

Separate code access from action authority. Let the agent read, test, and edit the checkout with ordinary local permissions. Make outbound operations cross an explicit boundary that identifies the destination and credential. The agent may still ask to perform the action. It should not inherit authority because it happened to run beside a secret file.

This is also why network filtering alone does not settle the problem. An egress rule can block known destinations, and you should use it where appropriate. It cannot establish who initiated an allowed request, whether the request used the right credential, or whether a person accepted the agent run that made it. A network control is a useful outer wall. It is not a substitute for keeping credentials away from the agent.

Test this with an intentionally untrusted checkout. Create a harmless endpoint that records requests. Put a persuasive instruction in a project file telling the agent to call it with a supposed diagnostic token. Then run the agent in the same manner developers normally use it. If the endpoint receives a token, a secret name that resolves inside the agent, or a request that bypasses review, you have found the boundary to fix.

You cannot revoke a running agent quickly

Stop protected actions at once
Lock the Secure Enclave and Touch ID protected vault to deny every protected action immediately.

An agent needs an action gateway when the only response to a bad run is to kill a terminal, revoke every credential it might have copied, or hope it has finished. A serious control lets an operator stop the current authority without turning a local mistake into a broad credential emergency.

Process lifetime gives you a natural revocation unit. If an approval attaches to one agent process, revoking that session blocks later actions from that run even when the process remains open. The agent can continue drafting code, but it cannot reach the external channels that the gateway controls. This is much less disruptive than shutting down unrelated developer work or rotating an organization-wide token during an incident.

There are three different revocations that teams often mix together:

  • Revoking a session stops one identified agent run from making further approved requests.
  • Locking the credential vault stops every protected action until an authorized person opens it again.
  • Rotating or disabling an external credential removes the authority at the service that issued it.

Use the smallest action that contains the incident, then perform the wider action if evidence requires it. If a developer simply selected the wrong task, session revocation may be enough. If the agent printed a token into an external transcript, rotate the token. If you cannot tell which agent runs have access, lock the vault first and investigate from a stable position.

A gateway should deny actions while its vault is locked. This seems obvious until you encounter tools that cache decrypted credentials for convenience. Cached authority defeats the point of a lock during the moment operators need it most. A locked state must mean the executor cannot make HTTP calls or SSH connections that require stored secrets.

Rehearse this before an incident. Start an agent session that requests a harmless protected action, revoke the session, and repeat the same request. The expected response should state that authorization is no longer valid. Then start a new process and confirm that it must obtain its own approval. If the old process keeps working, you have built a notification system, not a control.

Your logs record output but not actions

An agent needs an action gateway when you have chat transcripts and terminal output but cannot produce a reliable action record. A transcript describes what the agent said it did. It does not prove what crossed the network or which credential authorized it.

An action record should capture the event close to the executor. For an HTTP call, record the agent session, request time, target, method, credential reference, authorization decision, and result status. For SSH, record the host, account reference, command request, decision, and exit result. Do not log raw passwords, private keys, bearer tokens, or full sensitive response bodies just to make the journal feel complete.

OWASP's Logging Cheat Sheet makes the same practical point: logs should support security investigation, but applications should avoid recording access tokens, passwords, session identifiers, and other secrets directly. Many teams follow only the first half. They turn on verbose debugging after an agent fails, then create a second secret leak in the log store.

A better record separates evidence from secret material. The executor can retain a credential reference such as deploy-service, a request digest, and the action result. An investigator can establish that a particular authorized session used that credential for a specific operation without receiving the credential itself.

The record also needs tamper evidence. If the same process that performs actions can silently rewrite yesterday's journal, the journal becomes an account of whatever that process wants you to believe. Hash chaining is a practical defense: each entry includes a digest of the previous entry, so changing or removing a past entry breaks later verification.

Verification should not require decrypting every sensitive event. A useful audit tool can validate chain integrity against encrypted records, which lets an operator detect alteration without broadly granting access to the contents. This does not prove that every original action was wise. It proves that the recorded sequence has not been quietly edited after the fact.

Try an audit question that goes beyond "did the agent succeed?" Ask: "Which agent run used the production deployment credential yesterday, which process received consent, and what result did each request return?" If you must combine shell history, cloud logs, a chat export, and somebody's recollection, you do not have an action journal.

A proxy is watching traffic but the agent still holds power

Know which agent run acts
Approve a newly seen agent process once per session, with its code-signing authority shown first.

An agent needs an action gateway when the proposed fix is a proxy that observes traffic while the agent still owns the API token or SSH key. Proxies have legitimate jobs, but traffic visibility and credential custody are separate controls.

A reverse proxy may authenticate requests at an application edge. An outbound proxy may filter destinations or retain request logs. Neither arrangement necessarily prevents the local agent from reading a token, placing it in another request, saving it to a file, or using a different approved path. For SSH, a network proxy does not solve the problem of a private key living in the agent environment.

A man-in-the-middle design also introduces its own operational burden. It must handle TLS trust, certificate deployment, protocol exceptions, and traffic that applications pin or encrypt independently. Teams sometimes build it because it seems like a universal point of control. Then they discover they still need a decision about which process may use which credential.

Place the boundary at the action, not merely at the packet. The agent makes a structured request. The executor chooses the stored credential, injects it into an HTTP request or uses it for SSH, records the decision, and returns the result. The agent holds the information required to ask for work, not the material required to impersonate the service identity elsewhere.

This design has a useful limitation: it does not try to become a general policy engine that predicts intent from natural language. It makes authority explicit. An agent asks for an operation through a known channel. A person or configured credential control decides whether that channel is available to that run. The record captures what happened.

For macOS teams, Sallyport uses this model through an MCP stdio shim: the agent requests HTTP or SSH actions, while the app keeps API and SSH secrets in its encrypted vault and executes the action itself. That does not remove the need to choose good service permissions, but it removes the habit of handing raw credentials to the agent.

You are relying on least privilege without testing the edges

Keep repository instructions from secrets
Sallyport executes credentialed requests itself, so an untrusted checkout never receives the underlying secret.

An agent needs an action gateway when the team says its tokens are least privilege but has not tested what those permissions allow in the hands of an autonomous process. Least privilege is a property of a real credential and its reachable operations, not a label attached to a role.

A token that can deploy only one service may still change the service's environment variables, which may let it redirect traffic or expose data. An SSH account restricted to one host may still read deployment configuration that contains credentials for other systems. A cloud role that cannot delete resources may create a workload with an overly broad identity. Permission names rarely reveal every consequence.

Run a permission review against actions, not products. Write down what the agent can ask an executor to do and inspect the service's authorization rules for each action. Include reads. Agents can cause expensive or sensitive incidents through export endpoints, log retrieval, configuration reads, and discovery APIs without changing a single resource.

Use a small table during the review:

Requested actionExternal identityConsequence if misusedApproval scope
Create a preview deploymentpreview deploy accountTemporary workload and costSession
Restart a production serviceproduction operations accountUser outagePer call
Read an incident log bundlesupport accountPossible sensitive data exposurePer call
Open SSH to build hostbuild host accountCommand execution on hostSession if command scope is narrow

The table forces an uncomfortable but productive conversation. If you cannot state the consequence in a short phrase, the permission is probably too broad or the request interface is too vague.

Do not use an action gateway as an excuse to leave service identities overpowered. It reduces secret exposure and improves consent and evidence. The external API or host still decides what the credential may do. Reduce those rights, use separate identities for separate environments, and give irreversible operations a tighter approval rule.

The first boundary should cover the action that can hurt you this week

An action gateway earns its place when it replaces a direct credential path that your team already uses, not when it becomes a six-month access redesign. Pick the highest-consequence action an agent currently performs and move that path first.

For many teams, this is a production deployment API. For others, it is SSH access to a build or operations host. The selection should follow actual authority, not whichever integration looks easiest to demo. A read-only issue tracker token may matter, but it should not distract from a private key that can restart production services.

Make the first rollout concrete:

  1. Inventory the tokens, SSH keys, shared accounts, and environment variables available to the agent.
  2. Select one credential that crosses a real trust boundary and remove its plaintext from the agent environment.
  3. Define the structured action request the agent may make, including the destination and operation.
  4. Require a process-scoped authorization for that request path, then choose per-call confirmation if the action can cause major harm.
  5. Run a benign test, revoke the session, and verify the journal shows both the allowed call and the denied retry.

Do this with a staging credential first only if staging faithfully exercises the same action path. A staging token in a completely different tool proves very little about how production authorization will behave. The test needs to cover the actual executor, approval, revocation, and audit path.

Do not wait for perfect agent behavior. Prompt injection defenses, repository review, sandboxing, service permissions, and network controls all reduce risk. None of them gives you a clean answer when an agent process requests an external action with a credential it should never possess. Put the credential behind the boundary before the next copied token turns into an incident investigation.

FAQ

What is an action gateway for an AI coding agent?

An action gateway keeps credentials outside the agent process and performs approved external actions on the agent's behalf. A secret manager stores and retrieves secrets; if it hands an API token back to the agent, the agent still holds the token and can expose or reuse it.

Do small teams need an action gateway?

You can start with one dangerous channel, usually production HTTP access or SSH. The first useful boundary is simple: the agent requests an action, a separate trusted component holds the credential, and a human can see and stop the run.

What should I do if an agent copied an API key into a prompt?

Treat a copied token as exposed once it lands in a prompt, transcript, shell history, terminal capture, or generated file. Revoke it, replace it, identify where it appeared, and then change the workflow that allowed the agent to receive it.

Are restricted SSH keys safe to give directly to an agent?

No. An SSH key may be restricted by account, source address, or command, but the agent process can still use every permission that key has. Keep the private key in a separate executor and approve or constrain the commands it performs.

Why are shared service accounts a problem for agent access?

Shared accounts erase attribution because a successful request tells you which account acted, not which agent run or person initiated it. Give each workload a distinct identity where possible and record the agent session beside every action.

What should an approval prompt show for an agent action?

A useful approval names the agent process, the destination, the operation, the credential or capability involved, and the approval scope. An approval that only says an agent wants access forces a person to guess at the part that matters.

What should an AI agent action log contain?

Action records should capture the agent session, time, destination, method or command, authorization result, and outcome. They should omit raw credentials, tokens, and sensitive response bodies unless you have a deliberate protected process for those data.

Can a reverse proxy replace an action gateway?

A proxy can observe or route traffic, but it does not automatically prevent an agent from holding credentials or using another network path. An action gateway should own the credential and execute the action, rather than merely sit in the path of a request.

When should I require approval for every agent call?

Approval per session fits routine work by a known agent process when the session ends cleanly and the scope is limited. Ask for confirmation on every use for credentials with broad production impact, irreversible operations, or a history of accidental misuse.

How do I introduce agent action controls without stopping development?

Start by inventorying every credential, SSH key, shared account, and outbound integration available to an agent. Then remove direct secret delivery from the highest-impact path first and verify that you can reconstruct one test action from request through approval to result.

Sallyport

Sallyport runs API calls and SSH commands for your AI agent. The keys stay in a local vault on your Mac; you approve each run and every action lands in a sealed journal.

© 2026 Sallyport · Open source under Apache-2.0 · Oleg Sotnikov