Agent security
From Pull Request to Release: Reviewing a Coding Agent's Credential Path
Trace coding-agent credentials through branches, CI, artifacts and deployment. Review workflow edits, trust boundaries and release evidence.

Executive summary
A coding agent's credential path can extend beyond the pull request into CI jobs, artifact publication, and deployment. Review each identity transition before treating the proposed code as ready for release. Our worked review follows a synthetic change through those stages, identifying who can read secrets, change automation, and authorize production. It is a review method, not a report that Harden inspected a customer's pipeline or prevented a release incident.
Start with the identity used to propose the patch
The agent's first credential may allow repository reads and branch writes. Record the account, repository scope, permitted operations, expiry, and revocation owner. Do not assume that the visible author name describes the credential actually used by the tool.
Compare that authority with the assignment. Fixing a test may require a branch and pull request. It does not automatically require administration of repository secrets, release environments, or workflow permissions. Keep those operations behind their existing owners and controls.
Review local credential exposure as well. A developer workstation may contain deployment tokens unrelated to the task. A repository-scoped application identity does not constrain a separate shell that can read a broader credential from the environment.
The useful artifact is a path: task, local identity, repository operation, CI identity, artifact operation, and deployment identity. Mark where the authority changes and which system makes the decision. That reveals gaps that a single label such as “agent account” can conceal.
Treat workflow edits as changes to authority
An agent can alter a pipeline while appearing to change ordinary source files. Review modifications to workflow definitions, dependency installation, artifact handling, and deployment scripts for their security effect.
GitHub's secure-use guidance for Actions covers workflow security, untrusted input, credentials, and third-party actions. Apply the relevant guidance to your repository's triggers and permissions. A recommendation for one event type should not be assumed to describe another.
For the synthetic change, ask what the modified job can read and where it can send output. A newly added diagnostic step may expose a secret through a log or upload. A change to an event trigger may cause code from a different trust boundary to run with different authority.
Make those effects visible in the review. The maintainer needs the proposed behavior and the identity under which it executes. A short diff can still change a consequential boundary, while a large refactor may leave the credential path intact.
Follow untrusted inputs into privileged jobs
Pull-request titles, issue bodies, repository files, and dependency metadata can contain attacker-controlled text. When automation inserts that text into a command or sends it to an agent, examine how the input is interpreted.
The security question is concrete: does lower-trust content become executable syntax or an instruction that can influence a privileged action? Preserve the distinction between data describing a request and authority to execute it.
Use harmless fixtures for a review exercise. A synthetic pull-request field can contain a recognizable marker or a benign string designed to reveal interpolation. Inspect the resulting command construction without executing a destructive payload or accessing real secrets.
Keep event context in the evidence. Which revision ran, which repository supplied the code, which permissions were granted, and which environment received the artifact? A successful run alone does not explain those trust relationships.
Separate artifact publication from deployment approval
The workflow may build a package or container after the pull request merges. Record which identity can publish the artifact, how its source revision is identified, and which registry or storage location receives it.
Then review deployment as another decision. An artifact being available does not authorize production promotion. Keep the release owner, environment checks, and applicable approvals explicit. The agent's earlier authority to propose a change should not silently become deployment authority.
Inspect credential lifetime and audience at each transition. Prefer the narrowly scoped mechanisms supported by the platform and approved by the identity team. A secret stored centrally can still be overpowered when exposed to a job that does not need its full authority.
Record how emergency revocation works. If the branch-writing credential is removed, can an already running job continue with a separate deployment identity? The response plan needs to account for active sessions and downstream credentials, rather than assuming one token controls the entire path.
Build the evidence packet before the release decision
For this worked review, the packet contains the task, patch revision, workflow diff, effective permissions, test results, artifact reference, intended environment, and unresolved exceptions. Keep sensitive values out of the packet; identify credentials by approved references and scope.
Distinguish proposed operations from completed effects. A reviewed command, a successful CI status, and a deployed change establish different facts. Link the relevant records so a release owner can inspect the chain without reconstructing it from screenshots and chat summaries.
If a test fails, preserve the failure and its cause. Do not disable a boundary simply to obtain a green pipeline. A legitimate task may need a narrowly approved exception, but the exception should identify its resource, operation, owner, and expiry.
Recheck the path after changes to triggers, runner environments, reusable workflows, credentials, or deployment tooling. These changes can alter authority without changing the application feature that prompted the original review.
Evaluate runtime and code controls at their own boundaries
Code review examines the proposed software and automation. Runtime action checks examine supported operations the agent is about to perform. Neither evidence stream should be used as a substitute for the other.
Harden evaluates supported pending agent calls against relevant task context and policy. Verify the integration in the environment where the call occurs. A check on a developer laptop does not establish coverage of an independent CI runner or deployment service.
Use our review-before-merge article for the resulting code, and our credential guide for identity handling. Bring the credential path to Control, or Book a Call to identify the supported action boundary worth evaluating.
FAQs
Does opening a pull request require deployment credentials?
Usually the intended operations can be separated, but verify your platform and workflow. Give the proposing identity only the authority required for its task. Review any deployment credential available through the local environment or downstream automation as a separate access decision.
Is a passing CI status enough to approve generated code?
It establishes that the configured checks passed for a particular run. Inspect what those checks exercised, which revision and identity ran, and whether consequential workflow changes received review. Weak coverage or an altered trust boundary can remain despite a successful status.
What should we inspect in a workflow diff?
Look at triggers, permissions, secret access, command construction, dependency execution, artifacts, and deployment targets. Focus on changed effects and authority. A new diagnostic upload or a different event context can matter more than the number of changed lines.
Can one runtime installation protect the whole release path?
Do not infer that. Identify the supported integration and execution location for each relevant call. Local tools, hosted jobs, and downstream services can have separate identities and controls. State coverage per route and preserve gaps in the release record.
What should happen after suspected credential exposure?
Use the organization's incident process to contain affected jobs, revoke or rotate relevant credentials, and investigate downstream use. Preserve necessary evidence safely. Removing a secret from the final patch does not establish that earlier logs, artifacts, or sessions did not expose it.


