---
title: "Make the Workflow Prove What It Can Do"
description: "Audit an AI-generated CI workflow by tracing its triggers, permissions, actions and evidence against the requirement before letting it enforce or release anything."
author: "Gunner Technology"
published: "2026-11-26"
url: "https://www.gunnertech.com/blog/audit-ai-generated-ci-workflows"
---

# Make the Workflow Prove What It Can Do

Audit an AI-generated CI workflow by tracing every trigger, permission, action and result back to the requirement it is supposed to enforce. Then run it against safe and unsafe changes before you let it block, approve or release real work. A workflow file can look tidy while carrying authority nobody meant to grant.

## What should the workflow be allowed to decide?

Start with the requirement, not the generated configuration. Write down the event that should start the workflow, the decision it may make and the consequence of that decision. If the requirement says every proposed dependency change needs a security check, the workflow needs to identify those changes, run the approved check and preserve its result. It does not automatically need permission to merge or deploy.

Treat continuous integration, or CI, as the machinery that runs checks when code changes. The workflow is one control inside that machinery. Its name is not proof of its scope. A job called security can still skip the files that matter, run only on one branch or report success when the scanner never produced a result.

Keep the original requirement beside the review. If the requirement is vague, send the decision back to its owner before reviewing syntax. As [A Label Is Not a Requirement](https://www.gunnertech.com/blog/a-label-is-not-a-requirement) explains, a familiar name cannot supply the boundaries and proof the work is missing.

## Where can a generated workflow get more authority than intended?

It can gain authority through broad triggers, write permissions, inherited credentials and reusable jobs that do more than their caller suggests. Follow each of those paths. Record which events start the run, which repository or cloud resources it can change and which secrets become available at every step.

Do not stop at the top-level permission block. Inspect called workflows, third-party actions and helper scripts. A read-only-looking job can hand data to a script with a deployment credential, while a reusable workflow can inherit privileges from its caller. The effective boundary is the complete execution path, not the nicest-looking file in it.

Remove authority the job does not need. Separate checking from releasing, and bind release credentials to the protected route that owns that decision. This is the same reason [authority has to travel with the work](https://www.gunnertech.com/blog/authority-has-to-travel-with-the-work): permission should attach to a specific action, not float around the factory waiting to be borrowed.

## How do you prove the workflow catches the right changes?

Run a known-safe change and a deliberately unsafe change through the same route. The safe change should produce the required evidence and continue. The unsafe change should fail at the intended gate, leave a useful diagnosis and stay blocked even if the agent that created the workflow wants to proceed.

Test the edges around the happy path. Change a file just outside an include pattern. Remove a required tool result. Start the workflow from each event it accepts. Cancel and rerun it. These trials reveal filters that miss real work, failure settings that turn errors green and stale results that survive longer than the change they checked.

Make the test independent of the generated workflow's own claim. A job cannot establish its correctness merely by printing that it passed. Keep the expected conditions in a test fixture or policy owned outside the workflow, and compare the observed behavior with them. [Missing Evidence Cannot Pass a Release](https://www.gunnertech.com/blog/missing-evidence-cannot-pass-a-release) applies here without exception: absent proof is not a softer kind of success.

## What evidence should the workflow leave behind?

It should leave evidence that identifies the code version, the workflow version, the action that ran and the result that affected the decision. A green icon without those connections tells you only that something finished. It cannot tell a release owner what was checked or whether the evidence still belongs to the current change.

Preserve enough detail to reproduce a failure without copying secrets into logs. Keep inputs that define the check, the tool version, the relevant result and the final status. Redact credentials at the boundary and test that redaction. If a log must be hidden to protect a token, the workflow has already put the token too close to its reporting path.

Bind approval to the exact candidate that produced the evidence. A later edit, a changed dependency or a different workflow revision can invalidate it. The factory can gather the record and reject stale proof automatically. A person still decides whether the remaining risk is acceptable and whether the result is right.

## When is the generated workflow ready for production?

It is ready when its requirement is settled, its authority is narrow, its behavior passes both positive and negative trials and its evidence can be tied to the exact work it governs. Review the generated change like production code because it is production code: it can block the line, expose a credential or send an unproved change toward users.

Start in a repository or isolated environment where a mistake cannot release real work. Let the workflow observe first, compare its decisions with the existing route and repair the gaps. Promote its enforcement and release powers separately. That keeps a useful check from inheriting dangerous authority simply because both appeared in the same generated file.

AI can turn a requirement into workflow code quickly. That is useful, but generation is the beginning of the audit, not the end. The factory should make every trigger visible, every permission bounded and every decision reproducible before the workflow gets a vote on what ships.

## Quick answers

### Should an AI agent be allowed to fix the workflow it is auditing?

It can propose a repair, but the changed workflow needs a fresh independent check. Do not let the builder redefine the test that decides whether its own repair passes.

### Does a workflow need write permission to report a check?

Not necessarily. Give it only the permission required by the reporting mechanism, and keep merge, release and deployment authority on their own protected routes.

### How often should a CI workflow be audited again?

Audit it when its requirement, triggers, called actions, credentials or release role changes, and after a failure shows that its current proof missed something.
