pwn-ai-agent-loop

pwn-ai-agent-loop is a skill for Claude Code from 0dayInc/pwn. It costs 20 tokens per session (833 once invoked), scanned A, original, MIT.

A conversation loop for an AI agent that calls tools, handles their results, and continues until it can return an answer. It also records repeated tool failures and reminds the agent about known fixes.

In plain words
What is it for?
Use it to run PWN::AI::Agent conversations that need function calls, persistent memory of tool mistakes, and feedback when an approach keeps failing.
Why use it?
It prevents the agent from repeating the same failed tool call across turns or sessions and provides a consistent way to manage tool-based work.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to run PWN::AI::Agent conversations that need function calls, persistent memory of tool mistakes, and feedback when an approach keeps failing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/0dayinc/pwn/loop
View source ↗ 0dayInc/pwn
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add 0dayInc/pwn --skill loop
Clone the repo
git clone --depth 1 https://github.com/0dayInc/pwn

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pwn-ai-agent-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/0dayinc/pwn/loop/github.svg)](https://agentmods.dev/skills/0dayinc/pwn/loop)
Your own site
<a href="https://agentmods.dev/skills/0dayinc/pwn/loop"><img src="https://agentmods.dev/badge/skills/0dayinc/pwn/loop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pwn-ai-agent-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/0dayinc/pwn/loop"><img src="https://agentmods.dev/badge/skills/0dayinc/pwn/loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 833 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.00833
Opus 5.5 $0.00008 $0.00333
Sonnet 5.5 $0.00004 $0.00167
Haiku 4.5 $0.00002 $0.00083

Measured yesterday against content hash d6ebeef9cd85, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pwn-ai-agent-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

etc/default_skills/pwn/ai/agent/loop/SKILL.md · 61 lines

How it starts

The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PWN::AI::Agent::Loop

The agent conversation loop: build system prompt → call LLM with tools → if tool_calls: dispatch, append role:'tool' results, loop → else: return text. This replaces the regex-ReAct in PWN::Runtime::REPL :pwn_ai_hook with native function-calling. State (memory, skills, sessions) is all externalised — Loop.run is stateless aside from the messages array it builds. NEGATIVE-FEEDBACK CLOSURE ------------------------- Loop.run is where "learn from mistakes, don't repeat them" is actually enforced. On EVERY failed dispatch it: 1. Records the (tool, normalised_error) fingerprint into PWN::AI::Agent::Learning::Mistakes with a PERSISTENT cross-session count. 2. Reads that count back and, if it OR the in-turn count reaches REPEAT_THRESHOLD, prepends a hard "REPEATED FAILURE — change approach" guard to the tool result the model sees next. 3. Appends Mistakes.correction_hint (seen N×, sig, KNOWN FIX: …) so a previously-discovered fix is handed straight back to the model on the FIRST recurrence in a new session — it does not have to fail 3× again to re-learn what it already knew. PromptBuilder.mistakes_block re-injects the top open mistakes and top known fixes into the system prompt of every future turn. COMPLETION ---------- The original request is the completion signal. TaskSummarizer and Policy are advisory (compass / rank). Loop keeps calling CORE_TOOLS until that request is done or a tool returned failure evidence, then stops. LOCAL-MODEL SCAFFOLDING ----------------------- When the active engine is :ollama (or the corresponding :agent flags are set) Loop.run additionally: * threads request → PromptBuilder for relevance-ranked MEMORY, * threads request → Registry.definitions(relevance:) for a slimmed tool set (:tool_router), * splices Learning.exemplars_for(request:) between system and user as few-shot behaviour retrieval, * runs a plan-then-act pre-pass (:plan_first) so the model externalises a tool plan before its first dispatch, * escalates to a frontier persona for a 3-line corrective hint once ≥ ESCALATE_AFTER_FAILS in-turn failures accumulate (:escalation_persona) — the local model still produces the final answer so Learning/Metrics stay attributed to :ollama.

Read the full file on GitHub · 61 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · -5 lines d6ebeef9cd85
  2. 3mo ago Changed · +3 lines 638670454e08
  3. 3mo ago First seen · 63 lines · 20 tokens per session scan A d9cb90b87b4f

Subscribe to this mod's changes

pwn-ai-agent-loop is a skill published in the GitHub repository 0dayInc/pwn (102 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 833 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

pwn-ai-agent-loop compared with skills from other repositories

pwn-ai-agent-loop next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pwn-ai-agent-loop0dayInc/pwnSkill102todayMITA20Claude Code
performing-jwt-none-algorithm-attackxalgorix/xalgorixSkill1.6ktodayApache-2.0A34Claude Code, Codex
performing-zero-day-vulnerability-discoveryxalgorix/xalgorixSkill1.6ktodayApache-2.0B36Claude Code, Codex
analyzing-linux-elf-malwaremukul975/Anthropic-Cybersecurity-SkillsSkill37k3mo agoApache-2.0B82Claude Code
supabasePentesterFlow/agentSkill1.5k3mo agoApache-2.0A120Claude Code
sstiPentesterFlow/agentSkill1.5k3mo agoApache-2.0A99Claude Code
racePentesterFlow/agentSkill1.5k3mo agoApache-2.0A82Claude Code