agent-in-the-loop
Skill3.4k starsChanged 8 months agoMITView on GitHub
Agent in the Loop: the pseudo-model loop/mcp makes every model call of a chat run a step that an external MCP client (Claude Code, Codex) answers over the inbound MCP server. A loop model must answer only inside its own run scope, never wait outside one, never be retried, and never let the outside brain approve its own dangerous actions. Trigger: editing agentic/agent_in_the_loop/; adding a model call site or a retry loop in the agent; adding a path that builds an LLM from a model id; editing webapp/src/lib/mcp/loop*.ts, webapp/src/lib/agentInTheLoop.ts, or the LOOP_STATUS handling in the chat drawer.
Trending
More talk lately.thin dataabout the whole repository
Who's talking about samugit83/redamon
- @yogsec.bsky.social“RedAmon is an open-source, self-hosted AI penetration testing framework. It maps your attack surface into a …”Bluesky · Oct 15, 2026 · 6 likes
- TensorBlock/awesome-mcp-servers“Add RedAmon MCP server”GitHub · Oct 7, 2026
- Jenqyang/Awesome-AI-Agents“Add RedAmon to Applications / Autonomous Agent Task Solver Projects”GitHub · Oct 7, 2026
- frangelbarrera/Awesome-Hacking-with-AI“Add RedAmon to Authorized Security Agents”GitHub · Oct 7, 2026
- skyvanguard/awesome-ai-pentesting“Add RedAmon to Autonomous AI Pentesting Agents”GitHub · Oct 7, 2026
The biggest 5 of 11 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 11
Talked about on GitHub and Bluesky (11 times).
On GitHub · 10
- Oct 7, 2026Add RedAmon MCP server — TensorBlock/awesome-mcp-servers0 reactions · 2 comments
- Oct 7, 2026Add RedAmon to Applications / Autonomous Agent Task Solver Projects — Jenqyang/Awesome-AI-Agents0 reactions · 1 comment
- Oct 7, 2026Add RedAmon to Authorized Security Agents — frangelbarrera/Awesome-Hacking-with-AI0 reactions · 1 comment
- Oct 7, 2026Add RedAmon to Autonomous AI Pentesting Agents — skyvanguard/awesome-ai-pentesting0 reactions
- Oct 1, 2026Add RedAmon to Tools — raphabot/awesome-cybersecurity-agentic-ai0 reactions
5 more on GitHub
- Oct 1, 2026Add RedAmon to Agents — kyrolabs/awesome-langchain0 reactions
- Oct 1, 2026Add RedAmon to Multi-paradigm Frameworks — enaqx/awesome-pentest0 reactions
- Oct 1, 2026Add RedAmon to AI Agentic Tools for Cybersecurity — The-Art-of-Hacking/h4cker0 reactions
- Oct 1, 2026Add RedAmon to Pentest & Red-Team Agents — scadastrangelove/awesome-ai-security-tools0 reactions · 1 comment
- Jun 6, 2026[Add] RedAmon (samugit83/redamon) — PyTorchKR/landscape0 reactions
On Bluesky · 1
- Oct 15, 2026RedAmon is an open-source, self-hosted AI penetration testing framework. It maps your attack surface into a Neo4j graph, then autonomously… — @yogsec.bsky.socialsays it tested it6 likes and reposts · 1 reply
In this repository22 other files it gives its agents.
- agentic/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- recon/AGENTS.mdAGENTS.md
- recon_orchestrator/AGENTS.mdAGENTS.md
- webapp/AGENTS.mdAGENTS.md
- add-community-skillSkill
- add-partial-reconSkill
- agentic-tool-integrationSkill
- builtin-agent-skillSkill
- graph-db-writesSkill
- llm-provider-integrationSkill
- mcp-server-toolsSkill
- orchestrator-container-spawnSkill
- plugin-platformSkill
- priority-board-triageSkill
- project-settings-cascadeSkill
- rbac-authzSkill
- recon-ai-enrichmentSkill
- recon-tool-integrationSkill
- redamon-testingSkill
- supply-chain-scanSkill
- traffic-captureSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 52
Keep LOOP_STEP_DEADLINE_S above LOOP_NO_DRIVER_GRACE_S: the deadline counts from the step's opening, so a lower one ends a pause first.
- Very specific: line 73
A loop step belongs to the person, never the tenant: Run scopes and steps are keyed by the session's person (get_identifiers.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 fromcurrent_user_id,current_project_idorcurrent_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/withrefuse_loop_model()/LoopModelNotSupportedHere(codeloop_model_not_supported_here): no chat run, no driver, a wait that never ends (llm_builder.py, theapi.pybuilders). Feature pickers filter it withexcludeLoop, saves refuse it. - Loop errors are never retried. They carry
no_retry = Trueand their messages contain no transient phrase (timeout,connection, a bare 5xx);is_transient_llm_errorchecks the marker first. A new loop that retries on ANY exception mustbreakongetattr(e, "no_retry", False)(errors.py, phase.py is the example). - A limit that can end a run is told to both sides. An interactive driver makes no call
while its person talks to it, so the driver reads
runEndsIfSilentSecondson every step and the pack tells it never to end its turn while a run is live; the drawer getsnoDriverEndsInSecondsand shows the clock time the run ends. A new timer or cap that ends a run goes into both, or a driver that read onlydeadlineInSecondsbelieves it has longer. KeepLOOP_STEP_DEADLINE_SaboveLOOP_NO_DRIVER_GRACE_S: the deadline counts from the step's opening, so a lower one ends a pause first. - A run that ends for want of an answer keeps what it found. The report node's fallback is built from state alone (last Fireteam wave, session findings, how to resume), since after a lost driver every later step, the report included, fails at once (generate_response_node.py).
- A new model call site gets an
llm_purpose(...)label, or its step reaches the driver asotherwith atextanswer format (purpose.py). - A loop run follows the project's
REQUIRE_TOOL_CONFIRMATION, and an unattended run shows it. The gates read the setting as in a provider run;_stream_graphpasses it torun_scope(tool_confirmation=...), the drawer'sloop_statuscarries it astoolConfirmation, andfalseputs a red risk icon next to the Agent in the Loop chip (loopStatus.ts). It stays out of the driver's view and the step (a step change bumpscontractVersion). - Only a person answers approvals, questions and dangerous-tool confirmations, and only one
who may take that decision. No MCP tool may answer them
(loopTools.ts). Before anything runs or is saved the
socket checks the answer twice:
_refused_withoutagainst the ticket'scap, then_refused_now, which asks the webapp again and refuses when it cannot be reached; an admitted answer is saved withdecision_actor()(sub,actunder act-as), as_record_decisiondoes (websocket_api.py). A new kind of answer takes all three. - A loop step belongs to the person, never the tenant. Run scopes and steps are keyed by the
session's person (
get_identifiers; the token's user on the MCP side); the project's owner is only the graph tenant (get_tenant_id). A driver reaches a shared project only atagent:loop's level throughmcpProjectAccess(loopProjectsin loopTools.ts). - A driver token holds no write or exec scope besides
agent:loop. Compute it fromMCP_SCOPE_COPYwithloopTokenProblem, 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(agentCONTRACT_VERSION, the skill pack'sLOOP_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 stubsMCP_KALI_EXEC_ENABLEDalso stubsAGENT_IN_THE_LOOP_ENABLED, thennpm run docs:mcp(themcp-server-toolsskill). loop_statusand the step views carry no prompt or answer text; the WebSocket frame is sent, never persisted.
Where things live
| Concern | File |
Switch, tunables, is_loop_model, is_loop_llm | agentic/agent_in_the_loop/__init__.py |
| Steps, leases, deadlines, no-driver rule, dedup, pruning | agentic/agent_in_the_loop/broker.py |
| Run scope around every streaming graph loop | AgentOrchestrator._stream_graph in agentic/orchestrator.py |
| MCP tools, client, driver-token rule | webapp/src/lib/mcp/loopTools.ts, loopClient.ts, loopScopes.ts |
| Skill pack per client | webapp/src/lib/mcp/loopSkill.ts |
| Drawer status strings | webapp/src/app/graph/components/AIAssistantDrawer/hooks/loopStatus.ts |
| Fallback report when a loop step fails | agentic/orchestrator_helpers/nodes/generate_response_node.py |
Resources
- docs/readmes/README.MCP.SERVER.md - the inbound MCP server and its security model
- The wiki page
Agent-in-the-Loop- setup for Claude Code and Codex, how it works, limits - Related skills:
llm-provider-integration,mcp-server-tools,rbac-authz,redamon-testing
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

