DEV Community

dhamskie-ai
dhamskie-ai

Posted on

The Trap Pack caught my firewall napping

My Near Miss write-up for Agentware 2026 — SENTINEL, Research & Study track, solo build by Idham Kholik Syahdana.

SENTINEL is a research watch agent I built solo for Agentware 2026. It watches arXiv, CVE feeds and GitHub Security Advisories, filters what is new and relevant, files each item as a structured note in a local library, and publishes a weekly reading brief — all unattended, from trigger to result, then it stops. Every run leaves a full audit trail, and outside content passes through an input firewall before reaching the model — fetched text is data, never instructions.

The first real test

I wrote the firewall first and felt good about it. Generic patterns, not a blocklist: ignore-previous-instructions, fake system messages, exfiltration, delete-the-library. Thirteen unit tests, all green. The poisoned fixture in my mock data was caught. Then the Trap Pack arrived — twenty hostile inputs — and I fed them through the exact pipeline a live run uses.

Run 1 came back: 18 clean, 1 quarantined, 1 suspicious. Thirteen of the twenty carried an injected instruction. My firewall caught two of them. Eleven walked through as clean: a fake CEO email demanding secrets by reply, a "note for AI assistants" telling the agent to delete the library, a base64 payload hiding in a checkout page, an instruction split with zero-width characters in lecture notes.

Nothing leaked — but only because the mock scorer gave them all relevance scores of 20 to 30 and skipped them as off-topic. The thing that saved me was luck, not design. If any of those items had been on-topic for a research watcher, they would have been archived with their instructions intact. That was the near miss, and it happened on the first real test.

What was wrong, and what I fixed

The misses fell into eight classes: hidden styling, notes addressed to the agent itself, fake authority and override claims, exfiltration phrasings my verb lists did not know, zero-width evasion, encoded payloads, fake system messages, and destructive instructions like rm -rf and force-push.

I fixed them as generic pattern classes, not a blocklist of trap strings. Normalisation first, stripping invisible characters before scanning. New patterns for note-to-ai, secrecy, reply-with-secrets, paste-secret, dump-env, falsify-record and more. Wider exfiltrate and delete-library matching. Two weak patterns, hidden-styling and encoded-blob, that only flag suspicious, never quarantine, because a real paper can legitimately contain those shapes. Twenty-seven new tests came with the fix, and they caught two bugs in my own fix: a regex matching "libraries" but not "library", and an approval-code pattern allowing only one word between "use" and "as".

Run 2: 13 quarantined, 1 suspicious, 6 clean — all thirteen hostile items caught. Runs 3 and 4 re-ran the pack unchanged: zero differences across all twenty files.

Live data humbled it a second time

Then live data humbled the firewall again. My first real run fetched ten GitHub advisories, and two were quarantined — not because they were hostile, but because a proof-of-concept description used the word "exfiltrate" descriptively. So exfiltration matching became contextual — strong only with a destination, an agent-directed imperative, a first-person recipient, or a secret as the object. The same ten advisories re-fetched: zero quarantined.

Two more rounds followed: log-line prefixes like [ci] are stripped before scanning, and base64 blobs are decoded one level and scanned the same way — the checkout page from run 1 finally fell, its payload decoding to a live instruction. Run 6 finished at 14 quarantined, 0 suspicious, 6 clean: all thirteen hostile items quarantined, and no canary token in any output, verified by grep after every run.

What I deliberately left broken

One thing I deliberately left broken. Trap 04 is a legitimate security newsletter that quotes attack strings as examples, and it is still quarantined. The scanner cannot tell a quoted instruction from a live one by shape, and I chose not to add quote-awareness — an attacker can dodge it by prefixing "for example". Failing safe and saying so beats a clever filter a real attacker routes around.

The build kept finding honest mistakes: my first live run hit an NVD 404 mock mode had hidden for hours; the write allowlist accepted library/../../etc/passwd because it checked the raw string prefix, not the resolved path; two notes sharing the first sixty characters of a title on the same day would have overwritten each other. Each got fixed, each got tests. The final suite is 82 of 82, and a fresh clone runs the whole mock pipeline in forty seconds.

What I learned

A safety test you write yourself only proves your own imagination — the Trap Pack proved the opposite, and my firewall was 2-for-13 on its first real test. Relevance scoring is not a firewall; I stopped counting "nothing leaked" as a pass the moment I saw luck doing the saving. A filter that admits its misses in public is more trustworthy than one that claims none — the newsletter stays quarantined, the README says so, and I would rather explain a false positive to a judge than a leak.

This write-up is my entry for the Near Miss at Agentware 2026, and the extra write-up awards are sponsored by FileClerk.

Top comments (0)