I wanted to build a linter for one question: can a pull request change what a coding agent obeys, or what it is allowed to do, without a reviewer noticing? The idea had two rules that no existing tool had, as far as I could find. Before writing the tool I spent one evening measuring whether those rules would find anything in real repositories. They did not. This is the measurement, the decision, and what turned out to be worth keeping.
The plan
Coding agents now run in CI: an issue is opened, a workflow starts an agent, the agent comments or opens a pull request. Several public incidents and studies show the ways this goes wrong. Free tools already check the workflow side (zizmor, sisakulint, CodeQL's Actions queries, a Trail of Bits auditor skill, Aikido's open rules). My two rules were meant to cover what they do not:
- A workflow that checks out the pull request head before running an agent, so the agent's instruction and permission files come from the outsider.
- Hidden content in agent instruction files: zero-width characters, bidirectional controls, Unicode tag characters, HTML comments that address an AI.
I wrote down the criteria before the test. Go: at least 15 true findings in 200 repositories that the existing tools miss, and at least 80% precision per rule. Stop: precision under 60%, or fewer than 5 true findings.
The measurement
- Sample: repositories found through code search for four agent actions (Claude, Gemini, Codex, GitHub's AI inference action), stratified by stars. 178 repositories, because the stratum above 10,000 stars only had 28 candidates.
- Material: 2,725 workflow files and 294 agent instruction or configuration files, fetched at fixed commits. Read-only. Nothing was executed, nobody was contacted.
- A throwaway script applied the rules; every finding was then read and labelled by hand.
The result
Hidden content: 4 findings, 0 real. All four were a zero-width joiner inside an emoji. No bidirectional controls, no tag characters, no instruction hidden in a comment, in 294 files.
Checkout of the pull request head before an agent: 20 jobs, 0 real. Fifteen had a guard, three were misread by my script, two I could not decide.
The workflow rule overall: 11 true of 57 (19%). All 11 are the broad case "anyone can reach a powerful agent", which is the case the existing tools already describe. They sit in 3 repositories.
Both stop criteria were met. The go criteria were not. I did not build the linter. I removed the empty repository I had prepared for it.
What the measurement was worth anyway
A number I could not find anywhere else. In 93 of 178 sampled repositories (52%), a coding agent runs in a workflow that an outsider can trigger by opening an issue, commenting or sending a pull request. Most of them are protected, and often by a default of the agent action that is not visible in the workflow file. That is reassuring and fragile at the same time: the protection is one input away from being switched off, and the file does not show it.
The real problems were boring and serious. In three repositories, any GitHub user can reach an agent that holds broad permissions. Two of them carry the same copied template with the same flaw. No clever rule was needed to see this. The findings were checked independently, and the one repository with a private reporting channel has been told; nothing that identifies any of them is published here.
Copied templates spread. Two unrelated repositories had byte-identical vulnerable workflows. A fix in a popular template reaches more repositories than a linter does.
Limits
- I wrote the rules and the labels. There was no second labeller.
- I did not run the existing tools over the same sample, so I cannot say how many of the 11 they report.
- The sample is the top of a code-search ranking, not a random draw.
- A third idea, reviewing configuration changes inside pull requests over time, was not tested. It needs history, not a snapshot.
- A pattern being present is not proof that it can be exploited. Nothing was reproduced.
What I do instead
The measurement stays, as something to repeat: same sample method, a second labeller, every quarter, published as aggregate numbers only. The engineering time goes into the tool I already have, a security gateway for MCP, and into making its attack corpus runnable against other gateways.
The work was done by one person directing AI coding agents, with the criteria written down before the test and the labels read by hand.
Originally published at https://basartuncay.github.io/notes/measured-before-building/.
This article was written with AI assistance. I directed the work, and the numbers and findings in it were checked against the repository before publishing.
