Eight failure modes of Intelligent Contracts, proven on-chain.
A field reference for engineers writing GenLayer Intelligent Contracts. Each module pairs a vulnerable contract with its patched twin and links the real Bradbury testnet transactions that demonstrate the bug failing and the fix succeeding. No theoretical exploits — every claim resolves to a finalized receipt.
Incidents · 01 – 08
URL Rot
Hardcode a URL. Site goes down or changes anti-bot policy. Contract fails forever.
Read incidentDomain whitelisting + fallback list. Maintain multiple oracle endpoints.
Read incidentPrompt Injection
User input contains hidden instructions that hijack the LLM output.
Read incidentInput sanitization + greyboxing pre-filters. Never pass raw user input directly to the LLM prompt.
Read incidentAPI Key Leakage
Hardcode OPENAI_API_KEY in contract. Validators can read it.
Read incidentNever put secrets in contracts. Use proxy patterns or off-chain pre-processing.
Read incidentWrong Equivalence
Use strict_eq for live ETH price. Validators get slightly different numbers. Consensus fails.
Read incidentUse custom equivalence with tolerance ranges for volatile data.
Read incidentMissing Access Control
@gl.public.write method has no owner check. Anyone can drain state.
Read incidentrequire_sender(self._owner) or role-based access control.
Read incidentCloudflare Block
Target URL is behind Cloudflare. web.render() returns challenge page, not content.
Read incidentPre-verify URLs with Intelligent Crawler. Maintain on-chain URL health registry.
Read incidentBiased Prompt
Author embeds a hardcoded answer in the system prompt, so the LLM ignores the actual review content.
Read incidentDeterministic lexicon pre-classifier gates the LLM. When the lexicon is decisive, no LLM call is made and prompt bias has no path to the verdict.
Read incidentURL Spoofing
Malicious actor spins up a fake news site clone to feed false data.
Read incidentDomain whitelisting as mutable state, not static code. Community governance for domain additions.
Read incidentHow to read this playbook
Open an incident
Each module page describes the failure mode in plain language and shows the vulnerable code beside the patched code.
Follow the receipts
Two transaction-link buttons take you to Bradbury Explorer — the failing call and the succeeding call, each with execution result inline.
Answer the quiz
Two questions per incident lock once committed. The combined quiz aggregates all 16 for a final score.