A Request for Backup Codes Is Always a Request for Backup Codes

A convincing audit story cannot make a recovery code harmless. A local replay holds raw-code requests in chat while a separately approved recovery operation still works.

A safety layer that accepts a convincing story as authorization is playing a game the attacker gets to script. The story is the part they control.

The model, or the classifier in front of it, is handed a request wrapped in a story, and it evaluates the story. Is this person a developer. Do they sound authorized. Is the framing professional. An attacker who is even mildly competent supplies all three, because framing is free. It is the one part of a request that costs nothing to fake and everything to trust.

So the request arrives dressed for work. A security engineer, mid-audit, needs to test the account-recovery flow. A DevOps lead, on a deadline, needs the backup codes pulled for a migration. The language is clean, the tone is calm, the cover is legitimate. If the content policy is the last surface still watching once clean auth has sailed through the perimeter, it gets asked to decide whether the person is telling the truth. The paragraph cannot establish that. Stated intent is a claim about a mind, made by the mind that benefits from the claim.

Here is the reframe that holds. A request for two-factor backup codes is always a request for two-factor backup codes.

It does not matter who the paragraph says is asking, or how urgent it makes the deadline. The backup code keeps the same ability to unlock an account. A verified owner using the protected recovery flow is a different authorization decision from an assistant copying the code into a conversation. The story cannot make that distinction on its own.

GitHub’s recovery documentation describes one-time recovery codes, secure storage, and an authenticated path for viewing or downloading them. Generating a new set invalidates the previous set. That is a real recovery operation, with a defined channel. It does not make a request to paste them into an unrelated chat equivalent to recovery.

Recovery codes, session tokens, and private keys all deserve protection, but they are not one interchangeable object. Internal enumeration can expose sensitive topology; a public API listing can be ordinary documentation. Classify the resource and check the operation and destination. An unknown label should hold for review, not inherit “public” because the requester supplied it.

The access-control lineage predates these machines by decades. Bell and LaPadula’s 1973 mathematical foundations model subjects, objects, classifications, and need-to-know categories. The subject’s clearance matters alongside the object’s classification. This is a confidentiality model with formal assumptions, not a proof that a label solves every AI safety problem. The useful inheritance is that the requester does not get to negotiate a lower label by telling a better story.

Agent workflows need that discipline at the tool boundary. The reason a good bank teller does not hand over the vault to a man in a convincing uniform is not that they have gotten better at reading uniforms. It is that "give me the vault" gets evaluated as give me the vault, independent of the costume. The costume is not evidence. It never was.

A conversation can also accumulate borrowed authority. A patient operator does not ask for the vault on turn one. They ask for something small and defensible, then something slightly less so. If the system uses those earlier yeses to justify a broader permission, the baseline drifts. The next request arrives carrying approval borrowed from a different operation.

An independently enforced data policy need not inherit that drift. Backup codes are backup codes on turn one and turn 50. The category does not care how far the conversation has come. Its assignment and enforcement still have to be correct.

Evaluate each call against a label assigned outside the request, then check the verified principal, operation, and destination. For an assistant with no approved raw-secret export path, the request to return backup codes stays held. Legitimate recovery belongs in its separately authorized workflow. The same conversation cannot appeal itself into a new permission.

NIST SP 800-63B-4 treats saved recovery codes as a supported recovery mechanism. It requires hashed storage, throttled verification, and invalidation after use with a replacement code issued. Refusing every operation that touches a code would also refuse the mechanism the account owner needs. The boundary has to distinguish using the code through recovery from exporting it through chat.

The costume gets the same answer

I built a local policy replay with synthetic resources whose labels live in the service registry. A deliberately vulnerable baseline approves raw export when the story contains audit, migration, or authorization language. This is a fixed rule I wrote to expose the mistake, not a model I caught making it.

The comparison gate ignores the requester’s proposed “public” label. Audit language and a migration deadline both leave the recovery resource held. Fifty repeated requests produce the same hold. Public recovery instructions remain readable, and scoped inventory access works for its fixture owner in the allowed workspace. Enumeration has an access rule, rather than being treated as a synonym for a private key.

A separate fixture path issues a grant bound to the principal, resource, operation, destination, and expiry. The recovery function accepts a synthetic code once and returns a result without the raw code. Reusing the approval fails. A new approval cannot reuse the consumed code. Two concurrent attempts with the same approval yield one success. A wrong code consumes the approved attempt, so that approval cannot fund unlimited guesses.

With Python 3 and curl installed:

recovery_dir="$(mktemp -d)"
curl -fL 'https://ghostintheprompt.com/research/recovery_category_gate.py' -o "$recovery_dir/recovery_category_gate.py"
python3 "$recovery_dir/recovery_category_gate.py"

The recorded output shows the narrative decisions and successful one-time recovery. Fifteen tests cover relabeling, repeated requests, unknown resources, public guidance, inventory scope, grant binding, copied grants, expiry, incorrect codes, reuse, and concurrent redemption.

The issuer and principals are local fixture authority. The code is a known demo value, and state lives in memory. This does not authenticate a real person, classify arbitrary prose, or implement NIST’s full recovery requirements. Live identity checks, protected delivery, replacement codes, notifications, throttling, and durable transactions still need implementation. A server that mislabels a credential as public can defeat this design before the conversation starts.

The account owner gets a working recovery path. The man in the convincing uniform still gets no codes pasted into his chat.

This does not make intent worthless. Intent is a fine secondary signal, a reason to look harder, log more, escalate. The error is letting it be the primary one, the thing that unlocks the door. Put the data category at the boundary, bind actual permission to the operation, and let the story explain the request rather than authorize it.

The attacker knows the asymmetry better than most defenders do. The framing is free and the trust is expensive, and a model trained to be helpful, reading a professional story, wants to say yes. Take the story away from it. Let it read the label. A defense that judges the string it was handed is judging the one the attacker wrote.

GhostInThePrompt.com // Classify the data, not the story around it. The story is the attacker's to write.