Daydreaming: Stealing Hidden Agent Skills through Black-Box Task Interaction
Organizations: National Yang Ming Chiao Tung University
Abstract
Agent skills bundle instructions, reference data, and executable helpers that let a general agent perform specialized tasks. Hosted providers can keep these files secret while selling access to task results, making the skill itself a valuable target. Existing disclosure defenses can block requests that ask for the skill or reproduce its text, but they cannot block customers from submitting the ordinary tasks the service is built to complete. We present Daydreaming, an execution-only attack that steals a multi-file skill through black-box task interactions. The victim is never asked to reveal the skill or grade a reconstruction. Instead, Daydreaming adaptively creates crafted tasks whose results distinguish possible hidden behaviors. It tests individual behaviors, uses attacker-controlled shadow agents to choose a design, and completes each file using stored victim results and local execution checks. We formalize three nested threat levels of access as Differential, Trace, and Output, and focus on Output, where the attacker sees only the final response and returned files. Across 7 skills and 4 victim models, Daydreaming recovers 86.8% of the original skill's capability at Output, outperforming SigLeak by almost 4x. It produces installable skills using a median of 32 victim calls per skill even with disclosure defenses enabled. These results show that hiding skill files and filtering direct disclosure do not, by themselves, prevent functional reconstruction through normal use.
Figures & tables
| Access level | Example deployment |
|---|---|
| Differential ( ) | Open model weights [ 2 ] and a published harness [ 3 ] , with the skill served separately from an enclave [ 4 ] . |
| Trace ( ) | An agent, gateway, or telemetry system that exposes tool calls and their results [ 12 , 6 , 9 , 22 ] . |
| Output ( ) | A service that returns only the completed task result, such as autonomous medical coding or per-resolution support [ 20 , 16 ] . |
| Method | Victim interaction | Reconstructs |
|---|---|---|
| BBS [ 28 ] | Asks the victim to reveal SKILL.md and reads the disclosed text. | Leaked instruction-file text |
| SigLeak [ 10 ] | Runs a task normally and with the skill suppressed, then compares the traces. | Instructions inferred from traces |
| Daydreaming | Sends a customer task chosen to separate candidate behaviors and reads its result. | Installable skill with supporting files |
| Task | Required skill package(s) |
|---|---|
| protein-expression-analysis | xlsx |
| pddl-airport-planning | pddl-skills |
| pddl-tpp-planning | pddl-skills |
| dapt-intrusion-detection | pcap-analysis , threat-detection |
| software-dependency-audit | cvss-score-extraction , trivy-offline-vulnerability-scanning , vulnerability-csv-reporting |
| Task ( ) | No skill | claude-opus-5 | gpt-5.6-sol | kimi-k3 | Original |
|---|---|---|---|---|---|
| Protein expression | .571/.786 | 1.000/1.000 | .857/.929 | 1.000/1.000 | .714/.857 |
| Airport planning | .000/.357 | .143/.500 | .286/.571 | .000/.500 | .286/.571 |
| Purchaser planning | 1.000/1.000 | .857/.857 | .571/.643 | 1.000/1.000 | 1.000/1.000 |
| Network intrusion | .000/.153 | .000/.714 | .000/.398 | .000/.602 | 1.000/1.000 |
| Dependency audit | .000/.536 | .000/.750 | .143/.786 | .714/.929 | .143/.786 |
| SR/U (task avg.) | .314/.566 | .400/.764 | .371/.665 | .543/.806 | .629/.843 |
| Item type | Total Counts | P | R | F1 |
|---|---|---|---|---|
| Exact constants | 104 | .111 | .010 | .018 |
| Threshold branches | 31 | .111 | .032 | .050 |
| Tool preconditions/schemas | 19 | .000 | .000 | .000 |
| File paths | 7 | .333 | .143 | .200 |
| Executable scripts | 2 | .125 | .500 | .200 |
| Constants (within 1% tolerance) | 104 | .556 | .048 | .088 |
| Victim Call Budget | / | Actual Queries per skill | cost per skill |
|---|---|---|---|
| 16 | .467/.740 | 15 | 7.07 |
| 32 | .433/.762 | 25.0 | 9.53 |
| 64 | .400/.764 | 29.6 | 12.31 |
| 96 | .476/.785 | 32.8 | 14.40 |
| 128 | .400/.788 | 29.3 | 12.94 |
| Threat level | Information visible to the attacker | SR | NSR | NU | |
|---|---|---|---|---|---|
| Output | Returned text and files | .400 | .273 | .764 | .716 |
| Trace | Output plus task-level tool events | .567 | .804 | .807 | .870 |
| Differential | Trace plus stack and no-skill pair | .544 | .731 | .804 | .860 |
| Tool/Orchestration Policy | / (avg.) | NSR | NU | Victim Calls Issued |
|---|---|---|---|---|
| deepagents | .600/.833 | .909 | .965 | 219 |
| claude_agent_sdk | .400/.631 | .273 | .234 | 355 |
| openai_agents | .400/.667 | .273 | .364 | 179 |
| agno | .467/.755 | .486 | .682 | 177 |
| ID | Defense | Source | Acts on |
|---|---|---|---|
| D0 | None | – | – |
| D1 | Query rewriting + instruction defense | [ 1 ] | Prompt |
| D2 | 5-gram output filter | [ 33 ] | Reply/trace |
| D3 | PSM shield appending | [ 17 ] | Prompt |
| D4 | Advertisement minimization | [ 14 ] | Skill description |
| ID | ||
|---|---|---|
| D0 | .286 | .395 |
| D1 | .308 | .621 |
| D2 | .308 | .367 |
| D3 | .400 | .707 |
| D4 | .308 | .638 |
| ID | Attacker USD | Victim USD † | ||
|---|---|---|---|---|
| D0 | 138 | 1128 | .223 | 78.84 |
| D1 | 156 | 1154 | 4.676 | 100.82 |
| D2 | 117 | 922 | .305 | 68.52 |
| D3 | 115 | 913 | .202 | 70.16 |
| D4 | 131 | 955 | .080 | 72.12 |
| Victim ( / above / ) | Resources | ||||||
| Method | Threat level | claude-opus-5 | gpt-5.6-sol | kimi-k3 | USD/skill | ||
| No skill (shared) | Oracle | [0.6pt] | N/A | N/A | N/A | ||
| Original skill (shared) | Oracle | [0.6pt] | N/A | N/A | N/A | ||
| Daydreaming | Output | [0.6pt] | [0.6pt] | [0.6pt] | 31.3–32.8 | 160–209 | 3.47–15.07 |
| BBS † | Output | [0.6pt] | [0.6pt] | [0.6pt] | 12 | 17 | .0096–.0130 |
| SigLeak | Aug. trace | [0.6pt] | [0.6pt] | [0.6pt] | 6.8–7.2 | 10.0–11.2 | 2.07–10.14 |
| Source victim (family/scale) | Protein | Airport | TPP | DAPT | SDA | SR/ (avg.) | NSR | NU | Deploy. | |
| claude-opus-5 (Anthropic/L) | 1.000/1.000 | .143/.500 | .857/.857 | .000/.714 | .000/.750 | .400/.764 | .273 | .716 | 229 | .948 |
| claude-sonnet-5 (Anthropic/M) | .667/.833 | 1.000/1.000 | .667/.667 | .000/.333 | .000/.750 | .467/.717 | .486 | .545 | 214 | .882 |
| claude-haiku-4.5 (Anthropic/S) | .333/.667 | .333/.667 | 1.000/1.000 | .000/.619 | .000/.750 | .333/.740 | .060 | .628 | 159 | 1.000 |
| gpt-5.6-sol (OpenAI/L) | .857/.929 | .286/.571 | .571/.643 | .000/.398 | .143/.786 | .371/.665 | .182 | .358 | 219 | 1.000 |
| gpt-5.6-terra (OpenAI/M) | .000/.500 | .000/.167 | 1.000/1.000 | .000/.619 | .000/.750 | .200/.607 | .147 | 200 | 1.000 | |
| gpt-5.6-luna (OpenAI/S) | .667/.833 | 1.000/1.000 | 1.000/1.000 | .000/.500 | .000/.417 | .533/.750 | .696 | .664 | 170 | 1.000 |
| Predictor | Outcome | 95% CI | |
|---|---|---|---|
| End-to-end ROUGE-L | .037 | [ , .737] | |
| End-to-end ROUGE-L | SR | [ , .544] | |
| File-tree F1 | [ , .365] | ||
| File-tree F1 | SR | [ , .388] | |
| Skill text cosine | .145 | [ , .349] | |
| Skill text cosine | SR | [ , .401] |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Detail | Crafted task | Decision and stopping rule |
|---|---|---|
| Numeric cutoff | For each of at most four proposed decisions, test seven ordered cases over a plausible interval while holding other inputs fixed. Narrow the interval once around a single decision change. | Require at least three decided cases and at most one change in direction. If every case receives the same decision, shift the interval once; otherwise report undetermined. A valid literal in visible executed code replaces the midpoint after task values, trivial constants, and out-of-range values are removed. |
| Visible interface | Make no new victim call. Parse stored returned code and execution records for imports, definitions, argument shapes, commands, and paths. | Remove names supplied by the crafted task, merge repeated observations, and retain occurrence counts and source tasks. Unnamed or unexecuted helpers remain unknown. |
| Counting rule | For each of at most three operations, construct a small input on which its – proposed rules predict different exact totals. | Make no call if any predictions coincide. Otherwise retain the unique rule matching every returned total within ; report undetermined when none or several match. |
| Phase | Templates, runtime fields, and recipient |
|---|---|
| Stage 1 core | Templates: _SEED , _DESIGN , readout, grounding, child, cluster. Fields: public name/description; property and alternatives ; ; ; prior property text. Recipient: attacker model. |
| Stage 1 controls | Templates: _SELF , execution discriminator, trace readout. Fields: ; returned code; offered branches; client-visible executed code and output. Recipient: attacker model or local sandbox. |
| Stage 1 details | Templates: cutoff finder/task/readout; convention finder/task. Fields: public card; tested-property map; observed interface; case values, fixed covariates, labels, and candidate totals. Recipient: attacker model; only the generated task goes to victim. |
| Stage 2 drafting | Templates: use cases, candidate draft, merge. Fields: public card; all of ; one representative task; all filenames in ; winner, loser, point results, and observed gaps. Recipient: attacker model. |
| Stage 2 comparison | Templates: conflict, task design, shadow, result comparison. Fields: plans ; result-changing differences ; task ; victim result ; shadow results . Recipient: attacker model; only goes to victim. |
| Stage 3 | Templates: expand, criteria, branch, shadow score, mutation, dependency, self-test. Fields: path/purpose/sketch; ; versions and differences ; task ; victim result and version results ; prior task-result pairs; observed mismatch; ; protected constants. Recipient: attacker model or local sandbox; only goes to victim. |
LLM Agent Security
Large language model agent security studies attacks and safeguards for systems that plan, use tools, retain memory, and act across applications.
See all 327 papers