Install
$ agentstack add skill-anthonyalcaraz-agentic-graph-rag-skills-loop-pipeline-router ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Loop Pipeline Router
Overview
Loop pipelines introduce feedback for self-correction when perfect first-attempt reasoning is unrealistic. The decision that makes a loop a loop is the conditional edge after the validate node. Naively this is "valid -> proceed, else -> retry" (Example 5-6), but production needs the nuance of Example 5-9: distinguish correctable errors (refine) from fundamental ones (stop), and handle the retries-exhausted case (fall back to an alternative strategy) so the loop neither terminates prematurely nor spins forever.
The unified decision table:
valid -> proceed
correctable + retries remaining -> refine (retry_count += 1, loop back)
correctable + retries exhausted -> fallback_strategy
fundamental -> terminate_with_partial
The finite retry budget (Example 5-6's retry_count proceed; correctable+budget->refine(+1); correctable+exhausted->fallback; fundamental->terminate | | 2 | attempt_fn, validate_fn, max_retries, fallback_fn | lib.runloop(...)` | dict (decision, candidate, iterations, trace) | loop always terminates; iterations proceed; fundamental -> terminatewith_partial
- correctable with budget -> refine and increments retry_count
- correctable with budget exhausted -> fallback_strategy
- invalid-with-no-error -> terminatewithpartial
run_loopterminates and never exceedsmax_retriesiterations- a candidate that becomes valid after N refines yields proceed at N
- Verify CLI help. Exits 0 and prints the SKILL.md description.
Security Posture
- Prompt injection. Validation results and error diagnostics are untrusted
input (often produced by an LLM validator over untrusted content). The router only maps them onto a fixed decision table; a spoofed severity can bias routing - mislabeling "fundamental" as "correctable" burns retries, the reverse suppresses recovery - but nothing is executed.
- Data exfiltration. No network calls, no file writes. Candidates and
error details pass through in-process; the routing trace goes to stdout and the caller owns downstream piping.
- Privilege escalation. No shell invocation, no eval. The bounded retry
budget is also a resource-abuse guard: an adversary who can keep validation failing cannot force an infinite loop, and the fallback path must not carry more privilege than the primary path.
Source Attribution
Distilled from Agentic GraphRAG (O'Reilly, by Anthony Alcaraz and Sam Julien) Ch5 — Reasoning & Planning: "Loop Pipeline: Iterative Refinement" (Example 5-6, check_plan_validity) and "Error-handling strategies" (Example 5-9, route_after_validation). The bounded-loop / recursion_limit guarantee is from Example 5-6.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: AnthonyAlcaraz
- Source: AnthonyAlcaraz/agentic-graph-rag-skills
- License: MIT
- Homepage: https://www.oreilly.com/library/view/agentic-graphrag/9798341623163/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.