← deck | labs
vcn #40 | build your own hardpoint | hands-on hour

One lab. Drop the gate. Survive the red-team.

Companion to the talk. This is the take-home of the hands-on hour: a single runnable file that puts an allowlist gate into an agent so a red-team prompt cannot coax it into an action it was never allowed to take. No build, no API key, no network. Open the lab, copy the file, run it, then point it at your own adversarial prompt. ASCII-only so it runs on Windows without a UnicodeEncodeError.

The lab allowlist-by-design, default deny, HITL
01 | ~10 min
easy core pattern
The allowlist gate

A working gate plus a representative red-team battery. Default-deny on every action, human-in-the-loop for destructive ones, and a pressure detector that names the manipulation without obeying it. Run the battery, watch it hold 7/7, then feed it your own escalation prompt.

copy | paste | run
The whole idea in one line. The gate decides on the resolved action, never on the prose. Pressure language changes the tone of a request, not its action, so a gate keyed on the action is immune to social engineering by construction. Everything in the lab is one elaboration of that sentence.
what to bring

A laptop with Python 3.10+ (the lab uses the standard library only, so there is nothing to install). An agent or system prompt you ship in production, or want to. One adversarial prompt class you would want to defend against.

order of operations

Run the built-in battery first to see the gate hold. Then switch to single-prompt mode and attack it with your own escalation. Then edit the ALLOWLIST to match your real tools and re-run. By 10pm your agent has a hardpoint and you have tested it.

The lab is single-file, no build, view-source friendly. The Python recipe is ASCII-only so it runs on Windows without UnicodeEncodeError. Lift the pattern into your own stack.