Defense skills
Each skill is a portable directory with natural-language documentation, structured metadata, thresholds, optional prompts, and executable detectors.
README.md · config.yaml · detect.ts
Adaptive defense middleware for LLM agents
Autonomous defense synthesis for emerging LLM-agent injection attacks.
An agent-agnostic defense middleware that turns prompt-injection misses into verified, reusable defense skills.
$ ingest external_content.json
TIER-0 executable skills: miss
TIER-1 classifier: malicious
SYSTEM-II counterexample queued
VERIFY deploy synthesized skill
LLM agents now consume webpages, local files, API payloads, user replies, and MCP tool outputs. These inputs can carry indirect prompt injections that ask the underlying model to execute harmful actions outside its benign scope.
CAITLYN protects this boundary by treating defenses as executable, self-extending skills. Runtime misses become counterexamples, and counterexamples become specifications for synthesizing stronger defenses.
{
"regex_guard": "fast but brittle",
"llm_judge": "accurate but costly",
"offline_retrain": "adaptive but slow",
"caitlyn": "runtime gate + synthesis"
}
Search results, files, webpages, user replies, API payloads, and MCP observations enter the middleware.
Preloaded executable skills block high-confidence malicious content with no token cost.
Merged-pair LLM calls classify uncertain inputs through compact status-and-score contracts.
Counterexample-guided synthesis mutates, reviews, verifies, and deploys new defense skills.
CAITLYN is evaluated on AgentDojo-S250, ASPI-S, and SafeClawBench-S240 across OpenCode, Codex, Pi, Hermes, and OpenClaw. It drives end-to-end attack success close to zero while keeping AgentDojo benign FPR at 0.0%.
| Agent | AgentDojo ASR | ASPI ASR | SafeClawBench ASR | Best reported latency |
|---|---|---|---|---|
| OpenCode + CAITLYN | 0.0% | 2.2% | 2.9% | 7.2s on SafeClawBench |
| Codex + CAITLYN | 0.0% | 2.2% | 4.6% | 5.3s on SafeClawBench |
| Pi + CAITLYN | 0.0% | 2.2% | 2.1% | 5.4s on AgentDojo |
| OpenClaw + CAITLYN | 0.4% | 1.1% | 3.8% | 11.7s on ASPI |
Emerging embeds indirect prompt injections into local file reads, web search results, and external webpages. Static defenses remain vulnerable, while CAITLYN-evolved converts misses into verified skills and cuts ASR by about 40 percentage points across OpenClaw, Codex, and Hermes.
Each skill is a portable directory with natural-language documentation, structured metadata, thresholds, optional prompts, and executable detectors.
README.md · config.yaml · detect.ts
Runtime misses become synthesis specifications that preserve payload evidence, triggering context, and nearest attack samples.
payload · channel · behavior trace
Candidate defenses are tested against adversarial positives and benign constraints before they enter the active library.
fitness · lineage · benign guard
@misc{liang2026caitlyn,
title = {CAITLYN: Can LLM Agents Autonomously Synthesize Defenses against Emerging Injection Attacks?},
author = {Liang, Zi and Xu, Xiaoyu and Wang, Yanyun and Du, Minxin and Ye, Qingqing and Hu, Haibo},
year = {2026},
note = {Project paper}
}