Logo von 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).

Übersicht

HerausgeberAnthonyAlcaraz
Repositoryagentic-graph-rag-skills
Skill-Nameconstraint-guided-plan-validator
Sterne
29
Forks
9
Mitgelieferte Dateien
2
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • Mitgelieferte Dateien: 2

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von AnthonyAlcaraz auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Constraint Guided Plan Validator in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/constraint-guided-plan-validator
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

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
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Constraint Guided Plan Validator in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Constraint Guided Plan Validator automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Constraint Guided Plan Validator nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

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."

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill 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...

Warum Constraint Guided Plan Validator in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Constraint Guided Plan Validator besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Constraint Guided Plan Validator in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/reasoning-planning/constraint-guided-plan-validator ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Constraint Guided Plan Validator nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Constraint Guided Plan Validator verwenden?

So viele Sie möchten. In TypingMind können Sie Constraint Guided Plan Validator mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Constraint Guided Plan Validator kostenlos?

Ja. Der Skill wird von AnthonyAlcaraz auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇