Logo di Constraint Guided Plan Validator

Constraint Guided Plan Validator

Community
AnthonyAlcaraz
constraint-guided-plan-validator

Validate a generated plan against extracted domain constraints AND the agent's capability model before execution (Ch5 Constraint-guided planning, Example 5-14, plus the DevOps hypothesis-formation capability filter). Scores the plan 0..1, returns structured per-step feedback so a planning node can refine when the score falls below threshold, and filters steps the agent is not authorized to perform (e.g. a step needing write access when the agent holds read-only monitoring). Forbidden-action and capability violations are HARD — a plan the agent cannot legally execute does not pass regardless of score. Use in regulated or capability-bounded environments where plans must respect business rules and operational authority before any action runs. NOT for free-form creative tasks with no constraints, NOT for validating execution results after the fact (this gates the plan, not the outcome), NOT as the constraint extractor itself (it consumes extracted constraints).

Panoramica

Pubblicato daAnthonyAlcaraz
Repositoryagentic-graph-rag-skills
Nome della skillconstraint-guided-plan-validator
Stelle
29
Fork
9
File inclusi
2
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 2

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da AnthonyAlcaraz su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Constraint Guided Plan Validator in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/constraint-guided-plan-validator
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills.git /tmp/agentic-graph-rag-skills
mkdir -p .claude/skills
cp -r /tmp/agentic-graph-rag-skills/skills/reasoning-planning/constraint-guided-plan-validator .claude/skills/constraint-guided-plan-validator
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Constraint Guided Plan Validator in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Constraint Guided Plan Validator non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Constraint Guided Plan Validator non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Constraint-Guided Plan Validator

Overview

In regulated environments a planning node must ensure plans respect domain constraints and business rules before committing to execution (Example 5-14): extract the constraints from the request, generate the plan, validate, and if validation fails, refine with the validator's feedback. The chapter pairs this with two further gates:

  • Capability-model filter (DevOps hypothesis-formation node): the agent's operational boundaries are queryable data specifying which actions it may perform and at what privilege. "A hypothesis requiring direct database access gets filtered if the agent only has read-only monitoring permissions." This prevents proposing investigations it cannot execute.
  • Ontological grounding: domain/range validation rejects operations that are syntactically valid but semantically nonsensical before they corrupt the decision.

This skill validates a plan against extracted constraints and a capability model, returning a 0..1 conformance score plus structured per-step feedback. Below threshold (0.8) the plan should be refined and re-validated. Forbidden-action and capability violations are hard: any single one forces passed=False no matter the score — a plan the agent cannot legally execute is not "mostly fine."

In the DevOps latency investigation (account 123456789012), the agent holds read-only monitoring permissions. A remediation plan whose step proposes modify_db (write privilege) fails the capability gate and is sent back to the planner; a plan that proposes only query_metrics and read_logs (read) with the required record_incident step, within the 30-day emergency regulatory deadline, passes.

When to Use

  • Regulated / capability-bounded environments (insurance, healthcare, finance, privileged DevOps)
  • A planning node must gate plans against business rules and operational authority before any action runs
  • You want a refine-on-low-score loop driven by structured feedback

Phrases: "validate the plan against constraints", "capability model", "is the agent authorized", "constraint-guided planning", "plan conformance score", "refine plan with feedback".

When NOT to Use

  • Free-form creative tasks with no domain constraints
  • Validating execution results after the fact (this gates the plan, not the outcome)
  • You have no constraints or capability model to check against (then there is nothing to validate)

Process

StepInputActionOutputVerification
1constraint spec dictlib.extract_constraints(spec)list of Constraintmax_steps / deadline / forbidden / required parsed
2plan rowslib.steps_from_dicts(rows)list of PlanStepeach step carries action + privilege
3plan + capabilitylib.filter_executable_steps(plan, cap)list of capability Violationsa write step under read-only capability is flagged
4plan + constraints + capabilitylib.verify(...)ValidationResult(score, violations, passed)score in [0,1]; hard violations force passed=False; .feedback lists per-violation messages

Rationalizations

Agent rationalizationDocumented rebuttal
"Validate the result, not the plan — faster."The chapter validates before execution so the agent "won't attempt searches outside specified date ranges, exceed computational budgets, or violate domain rules." A bad plan caught post-execution has already taken the unsafe action.
"Score is 0.85, ship it."A high score does not override a hard violation. A forbidden action or an unauthorized step makes the plan illegal to run; passed is False regardless of score. Treat hard violations as blocking, not as score deductions.
"The agent can probably do that step anyway."The capability model is the authority, not the agent's optimism. A step needing write access when the agent holds read-only is filtered — proposing investigations it cannot execute is a named failure mode.
"Refining wastes a turn — just run the plan."Refine-on-low-score is the whole pattern (Example 5-14): the validator's feedback turns an invalid plan into a valid one before execution, which is far cheaper than a failed or non-compliant action.

Red Flags

  • Every plan scores 1.0. No constraints were extracted or the capability model is empty — the gate is inert.
  • Hard violations present but passed=True. A bug — capability / forbidden-action violations must force passed=False.
  • Capability model allows every action at admin. The operational-authority boundary is not actually bounded; the filter cannot protect against over-privileged steps.

Non-Negotiable Verification

  1. Run the benchmark battery. python cli.py benchmark must report:
    • a conforming plan passes with score 1.0
    • too-many-steps drops the score below threshold
    • a missing required action is flagged
    • a forbidden action is a hard violation (passed=False)
    • a write step under read-only capability is a hard violation
    • a deadline-exceeding step is flagged per-step
    • score stays within [0,1] and .feedback enumerates violations
  2. Verify CLI help. Exits 0 and prints the SKILL.md description.

Security Posture

  • Prompt injection. Plans are typically LLM-generated from untrusted requests - exactly why they are validated. Plan steps and constraint specs are parsed as data, never executed; a malicious step name can at most fail validation. The constraint spec and capability model must come from the trusted policy source, not from the same LLM that wrote the plan.
  • Data exfiltration. No network calls, no file writes. Plans and constraints may describe privileged operations; they stay in-process and surface only in the stdout feedback the caller owns.
  • Privilege escalation. This gate exists to block it: a write step under a read-only capability is a hard violation. Keep it that way - passed=False on hard violations must never be softened into a score deduction, and the gate composes with (never replaces) boundary-side IAM enforcement.

Source Attribution

Distilled from Agentic GraphRAG (O'Reilly, by Anthony Alcaraz and Sam Julien) Ch5 — Reasoning & Planning: "Constraint-guided planning" (Example 5-14, ConstraintAwarePlanningNode), the capability-model filter from "Integrating the Knowledge Graph for Grounded Hypotheses," and the domain/range checks from "Ontological Grounding: Keeping Your Agent in Reality."

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Constraint Guided Plan Validator?

Validate a generated plan against extracted domain constraints AND the agent's capability model before execution (Ch5 Constraint-guided planning, Example 5-14, plus the DevOps hypothesis-formation capability filter). Scores the plan 0..1, returns structured per-step feedback so a planning node can refine when the score falls below threshold, and filters steps the agent is not authorized to perform (e.g. a step needing write access when the agent holds read-only monitoring). Forbidden-action and capability violations are HARD — a plan the agent cannot legally execute does not pass regardless...

Perché usare Constraint Guided Plan Validator su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Constraint Guided Plan Validator è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Constraint Guided Plan Validator in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/constraint-guided-plan-validator. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Constraint Guided Plan Validator?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Constraint Guided Plan Validator?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Constraint Guided Plan Validator: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Constraint Guided Plan Validator è gratuita?

Sì. È pubblicata su GitHub da AnthonyAlcaraz con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇