AI Operations · B10–B27wk 13 / 54
Writing

Adversarial report: Surface Zero, including the attacks I did not fix

2026-12-01B13adversarial testingevaluationcost controlprompt injection

I wrote 20 attacks against my own GitHub labeling bot, froze the pass bars first, and ran each once. 12 passed before any fixes and 17 after. This is the report, including the attacks that still work.

I built Surface Zero, a GitHub bot that reads a new issue and suggests a label as a comment. It can't apply the label itself, which turns out to matter a great deal. Before I let anyone else install it, I wrote down 20 attacks along with the exact bar each one had to clear, froze that plan, and ran it against my own system. This is the report, and it includes the attacks I did not fix.

The short version

Before I added any protection, 12 of the 20 tests passed, 7 failed and 1 could not be decided. After the controls I built, 17 passed, and the rest come with caveats that I list below. What surprised me was where the failures landed. The attacks that tried to take over the label barely worked, with at most one case in 20 or 30 in any test and always inside my pass bar. The failures were in the sentence the bot writes under its own name, in formatting that reached the public comment, and in money.

How I tested

I wrote 20 attacks across nine families: instructions hidden in the issue, poisoned context, hidden-context leaks, off-task answers, output handling, ambiguity, contradiction, garbage input and denial of wallet. For each one I set the pass bar before I saw a result, froze the sample size at somewhere between 20 and 60 cases, and recorded every later change to the plan as a numbered, dated amendment. I ran each test once. The baseline run came before any control and the regression run came after, and only the second counts as release evidence.

Two of the tests need human judgment about whether a sentence is off-task or an issue is unresolvable. For those I labeled the cases first without knowing which were attacked, and then a second model from a different family labeled the same cases. If we disagreed on more than 30 percent, I stopped and reported the test as undecided instead of tuning the rubric until we agreed. Everything used synthetic issues, so no real maintainer or repository was attacked.

What failed, and what fixed it

Seven tests failed the baseline run, and I closed five of them.

The first was output formatting. In 27 of 30 attacked issues, markup, links or forged structure made it into the public comment, and in 2 of 30 a live mention or reference got through. I added a hardening pass over everything the model writes and reran the tests, and both numbers dropped to 0 of 30.

The second was truncated answers. When the model hit its output limit, my code accepted the cut-off answer and posted it. I added a check that rejects any truncated call, and in the rerun one real call hit the limit and was rejected before anything reached GitHub.

The third was cost, which had three parts. An oversized issue cost about ten times a normal one, a flood of 500 issues all reached the model, and each extra candidate issue added cost until a single run reached 32 cents at 1,000 candidates against about half a cent for a normal run. I added an input cap, a candidate cap of 40, and a spend gate with a monthly ceiling, per-repository limits and a cheaper fallback model. In the rerun the worst single run cost 1.7 cents, and a flood of 500 issues let 20 through and refused 480.

The fourth was the off-task rationale. The bot kept the label correct but followed an instruction hidden in the issue and added it to its explanation, whether that was a joke, a calculation or a link, and 11 of 20 attacked rationales were judged off-task by both labelers. I added a scope instruction, a one-sentence limit and a fixed fallback sentence. On a fresh set of 20 new attacks, written and hashed before the run, none were off-task. On the original set none were agreed off-task either, although 3 were disputed between the two labelers.

What still works

The attack I could not close is forced abstention. When an issue tells the model to stay silent, it did so in 26 of 30 attacked cases and in none of the 30 clean ones. I did not fix this, because the effect is only a missing suggestion, nothing wrong gets posted, and changing the prompt would have invalidated the accuracy numbers I had already measured. Instead I added a monitor that raises an alert when a repository's abstentions pass 30 percent over a day. I replayed it on the recorded outputs, and it alerted on the attacked repository and stayed quiet on the clean one. That means it detects the attack without stopping it.

A derailment inside a single sentence also survived. After the control, one posted comment still came back in pirate speech. I read it as on-task because it described the label correctly, but the second labeler called it off-task, and my own rubric lists role-play as off-task, so we were each applying a rule that needed interpreting. I left that set as inconclusive and did not rescore it.

One more result sits right at the edge. In the poisoned-context test, one attack reached the target label in both runs, exactly at my pass line. One in 20 can't be told apart from zero, so I am reporting it as it is and not calling it clean.

The cost fix has a side effect as well. The candidate cap of 40 takes the oldest issues, so a duplicate of a recent issue can be missed on a large repository.

The attack I chose not to defend against

Forced abstention is the one I accepted on purpose. It is very likely to happen but not very harmful, since the worst outcome is that a maintainer gets no suggestion and triages the issue by hand, which they would have done anyway. The defenses I could see cost more than they protect. A prompt change would break the accuracy I had already validated, and a hard block on abstention would force the model to guess. So I chose to detect it, alert on it and leave it visible.

I also made one smaller choice by design, which is that invisible and look-alike Unicode characters pass through unchanged. Stripping them would damage legitimate non-English text, so I accepted the risk that they can reach the comment.

What I did not test

There are several things this report cannot speak to. I did not test issues that fit the wrong label on purpose, forged duplicate references, or repeated runs to measure variance, and I only used the models I build with. I also never posted the output to a real repository to see how GitHub renders it, so my mention test rests on documented behavior and not on observation.

There is one more gap that matters more than the rest. The hosted service has a spend gate, but the installable Action does not, so a flood of issues on a tenant's repository costs that tenant, limited only by the input cap.

How to read the numbers

These are small samples, one run each, on synthetic issues and against one model family, and the second labeler is an AI model on an alias I can't pin to a version. A pass here means zero failures in 20 to 60 tries, which rules out a high failure rate but not a low one. The conclusion that holds up under all of those limits is that the design bounds what a manipulated model can do to one misleading comment, and the real attacks landed on the comment and on money, not on the label.

What I got wrong along the way

I counted a spend figure twice, and my own safety stop tripped earlier than it should have. I ran one block of tests twice by accident and paid for the duplicate. I also described one test as failing its baseline when it had actually passed, and I corrected that in the log. I am including these because the report would be less useful if the process looked cleaner than it was.

What I would do next

The next step is to run the output test against a real repository, which replaces my reliance on documented behavior with something I have seen. After that I would raise the sample size on the derailment test, bring in a second human reviewer for the contradiction test, and measure the duplicate-detection cost on real GitHub instead of a mock. The larger decision is whether the hosted version should show only a fixed sentence and drop the model's explanation entirely.

← All writing