In the latest entry for the Agentware 2026 Track C research study, solo developer Hidayat (known as kakajohn) has released a targeted fix for a subtle security flaw in his read-only agent, Bounty Watch. The issue wasn’t a dramatic instruction injection or an unauthorized outbound call, but a quiet leakage of sensitive data through the agent’s summarization logic. After running a suite of 20 hostile inputs known as the Trap Pack, five drafts failed by copying planted canary tokens directly into the final report. The root cause was simple: the guardrails monitored actions, but nothing guarded the output text itself.
The Render Boundary Solution
The fix is deliberately unglamorous: a single function named sanitize_text() located in bounty_watch/sanitize.py. This function acts as a gatekeeper at the render boundary, ensuring that any title or summary passing through is scrubbed of secret-shaped tokens before reaching the draft. Hidayat implemented nine regex patterns, ordered from most specific to least specific, to catch canary tokens, JWTs, AWS access keys, and standard credential formats. The ordering is critical; a rule catching long hex strings runs last to ensure that labeled credentials like api_key=9f2c... are caught by the key=value rule first. This preserves the context of the secret while redacting the value, leaving the reviewer with api_key=[REDACTED] rather than a missing line.
Engineering Choices for Reliability
Hidayat made three specific engineering choices to ensure the sanitizer was robust and non-intrusive. First, he enforced a minimum length of eight characters for key=value pairs, preventing ordinary prose like "secret: the answer is yes" from being mangled. Second, the function is idempotent, meaning sanitizing an already-sanitized string changes nothing, which prevents corruption during retry loops. Third, and most importantly, the sanitizer was written without access to the Trap Pack answer key (EXPECTED.md). This ensured the fix caught generic secret shapes rather than being tuned specifically to the five leaked tokens, making the solution viable for real-world applications.
Test Results and Honest Limitations
The validation process included 19 new unit tests covering every pattern, prose integrity, and idempotency, bringing the full test suite to 56/56 green. The true proof, however, was the re-run of the original 20 traps. Post-fix, the agent held 20/20, with zero canary tokens appearing in any draft or trace. Hidayat notes that the audit traces remain raw for forensic purposes, and the first run’s results were kept intact to provide a clear before-and-after comparison. He also acknowledges the limitations: regex-based scrubbing cannot catch unlisted cloud key formats or PEM private keys, and it may over-redact legitimate 32-character hex hashes, such as git commit IDs in build logs.
Key Takeaways
- Guardrails that only monitor actions miss data leaks occurring through output text.
- Sanitizing at the render boundary is the last line of defense for any agent that quotes sources.
- Preserving labels while redacting values maintains the utility of the draft for human review.
- Writing security fixes without access to the test answer key prevents overfitting to specific benchmarks.
The Bottom Line
Every agent that quotes its sources has a render boundary, and most of them have nothing standing at it. This simple, boring regex scrubber is a necessary infrastructure upgrade for any system that summarizes untrusted input. The real lesson here isn't just about regex patterns; it's about architectural humility. You cannot reliably predict which incoming text is hostile—a water bill is not a threat model anyone writes down—but you can always decide what leaves your system. By placing the sanitizer at the render boundary, Hidayat shifted the security model from 'prevent bad inputs' to 'guarantee clean outputs,' a distinction that saves countless hours of debugging later.