How to separate CI coding-agent secrets from local credentials

Use a job-specific identity and pass only the variables the task needs. Avoid giving automation your personal shell or broad build secrets.

Example

A CI workflow needs to submit a code-review request, but should never receive production deployment tokens.

What to do

  1. Inventory job environment variables and distinguish model access from deployment. Give the agent job its own workspace and test credentials.
  2. Avoid passing privileged values into steps triggered by untrusted contributions. Keep deployment outside the agent job's permissions.
  3. Run a fork or low-trust scenario with fictitious values and inspect retained artifacts for unintended credentials.

How to verify

The workflow can create a redacted review using its limited key and has no access to production deployment.

Limits

Input filtering does not limit what a CI identity can do. Scope repository and cloud permissions separately.

Spendplane for this workflow

Set up a Spendplane gateway key

Related reading