agent-in-the-loop

agent-in-the-loop is a skill for Claude Code, Codex from samugit83/redamon. It costs 150 tokens per session (1,313 once invoked), scanned A, original, MIT.

A set of rules for connecting an AI model's chat steps to an outside MCP client, such as Claude Code or Codex. It defines when the model may run and how loop errors must be handled.

In plain words
What is it for?
Use it when changing the agent's step broker, model-building paths, loop routes, MCP tools, or loop status handling.
Why use it?
It prevents chat steps from waiting forever, running outside their allowed session, or being retried when they should not be.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it when changing the agent's step broker, model-building paths, loop routes, MCP tools, or loop status handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/samugit83/redamon/agent-in-the-loop
About the project

RedAmon is an AI framework that connects reconnaissance, exploitation, and post-exploitation activities into an automated security-testing pipeline, while organizing findings and proposing code fixes. It is for authorized penetration testing, security research, and education. The catalogue entries provide skills and instructions for working with the framework.

samugit83/redamon · 3,277 stars · on GitHub · redamon.org

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 samugit83/redamon --skill agent-in-the-loop
Clone the repo
git clone --depth 1 https://github.com/samugit83/redamon

Made for: Claude Code, Codex.

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 agent-in-the-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/samugit83/redamon/agent-in-the-loop/github.svg)](https://agentmods.dev/skills/samugit83/redamon/agent-in-the-loop)
Your own site
<a href="https://agentmods.dev/skills/samugit83/redamon/agent-in-the-loop"><img src="https://agentmods.dev/badge/skills/samugit83/redamon/agent-in-the-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 agent-in-the-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/samugit83/redamon/agent-in-the-loop"><img src="https://agentmods.dev/badge/skills/samugit83/redamon/agent-in-the-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 150 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,313 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.
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.00150 $0.01313
Opus 5.5 $0.00060 $0.00525
Sonnet 5.5 $0.00030 $0.00263
Haiku 4.5 $0.00015 $0.00131

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

Security

Grade A, and why

agent-in-the-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 today.

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.

skills/agent-in-the-loop/SKILL.md · 84 lines

How it starts

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

When to Use

  • Changing the step broker, the adapter, the prompt document or the /loop/* routes.
  • Adding a model call to the agent, or a loop that retries model calls.
  • Adding any endpoint, job or feature that builds a chat model from a model id.
  • Changing the loop MCP tools, their scope, the driver-token rule, or the drawer's loop status.

Critical Rules

  • A loop model answers ONLY inside a live run scope of its session that uses the loop. Its identity comes from get_broker().scope_for_session(current_log_session_id), never from current_user_id, current_project_id or current_session_id: initialize_node calls the guardrail and the classifier before any node sets those (model.py, agent_context.py).
  • A new path that builds an LLM from a model id refuses loop/ with refuse_loop_model() / LoopModelNotSupportedHere (code loop_model_not_supported_here): no chat run, no driver, a wait that never ends (llm_builder.py, the api.py builders). Feature pickers filter it with excludeLoop, saves refuse it.
  • Loop errors are never retried. They carry no_retry = True and their messages contain no transient phrase (timeout, connection, a bare 5xx); is_transient_llm_error checks the marker first. A new loop that retries on ANY exception must break on getattr(e, "no_retry", False) (errors.py, phase.py is the example).
  • A new model call site gets an llm_purpose(...) label, or its step reaches the driver as other with a text answer format (purpose.py).
  • Dangerous tools always ask a person in a loop run. Read the setting through confirmation_required(get_setting('REQUIRE_TOOL_CONFIRMATION', True)), never directly.
  • Only a person answers approvals, questions and dangerous-tool confirmations. No MCP tool may answer them (loopTools.ts).
  • A driver token holds no write or exec scope besides agent:loop. Compute it from MCP_SCOPE_COPY with loopTokenProblem, never a hand list; the loop tools refuse wider tokens (loopScopes.ts).
  • A person picks the brain. MCP writes, presets, imports and user defaults never set a loop model (loopModelRefusal, the preset checks, rememberedDefaults).
  • Any change to the step shape bumps contractVersion (agent CONTRACT_VERSION, the skill pack's LOOP_CONTRACT_VERSION), so a client's out-of-date skill says so.
  • A new loop tool joins LOOP_TOOL_NAMES (withdrawn while the switch is off), every MCP test that stubs MCP_KALI_EXEC_ENABLED also stubs AGENT_IN_THE_LOOP_ENABLED, then npm run docs:mcp (the mcp-server-tools skill).
  • loop_status and the step views carry no prompt or answer text; the WebSocket frame is sent, never persisted.

Read the full file on GitHub · 84 lines

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. today First seen · 84 lines · 150 tokens per session scan A aa951e9a8a42

Subscribe to this mod's changes

agent-in-the-loop is a skill published in the GitHub repository samugit83/redamon (3,277 stars, last pushed yesterday), licensed MIT. It adds 150 tokens to every session and 1,313 once invoked, about $0.0006 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-11-04.

Related

Other skills, from other repositories