# konoeph/agentclaimguard architecture

> Architecture diagram of the GitHub repository konoeph/agentclaimguard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/konoeph/agentclaimguard
- Repository: https://github.com/konoeph/agentclaimguard

## Overview

AgentClaimGuard is a runtime gate that decides whether structured LLM claims may be returned under evidence, tool-result, and policy contracts. The main path is agent output into verification, where per-claim validators produce pass/block statuses and safe fallback output; adapters embed this check in LangChain or LangGraph, while the HTTP server exposes it to callers. Claim extraction is a separate optional helper, not verification. Core calls are supported by indexed source references and excerpts; adapter and server entry points are also documented in the README.

Main entry points: [`agentclaimguard/core/verifier.py`](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/verifier.py) (Claim verifier), [`agentclaimguard/core/runtime.py`](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/runtime.py) (Guard runtime), [`agentclaimguard/extractors/claims.py`](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/extractors/claims.py) (Claim extraction), [`agentclaimguard/core/policy.py`](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/policy.py) (Policy rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and policy"]
  node_extract["Claim extraction<br/>[claims.py]"]
  node_claim["Claim model<br/>[claim.py]"]
  node_evidence["Evidence model<br/>[evidence.py]"]
  node_toolresult["Tool result model<br/>[tool_result.py]"]
  node_policy["Policy rules<br/>[policy.py]"]
  node_builtin["Built-in policies"]
end

subgraph group_verification["Verification engine"]
  node_runtime["Guard runtime<br/>[runtime.py]"]
  node_verifier["Claim verifier<br/>[verifier.py]"]
  node_citation["Citation binding"]
  node_required_evidence["Evidence requirements"]
  node_required_tool["Tool requirements<br/>[tool_required.py]"]
  node_forbidden["Forbidden verdicts"]
  node_conflicts["Conflict detection<br/>[conflict_check.py]"]
  node_result["Decision and safe output<br/>[result.py]"]
end

subgraph group_integration["Integrations"]
  node_langchain_runnable["Runnable wrapper<br/>[runnable.py]"]
  node_langchain_middleware["Chain middleware<br/>[middleware.py]"]
  node_langgraph["Graph guard node<br/>[node.py]"]
end

subgraph group_exposure["HTTP interface"]
  node_server["HTTP verification API<br/>[main.py]"]
end

node_agent(("Agent workflow"))
node_caller(("HTTP tool caller"))

node_agent -.->|"supplies claims"| node_extract
node_extract -->|"creates claims"| node_claim
node_agent -->|"submits claims"| node_runtime
node_runtime -->|"invokes"| node_verifier
node_verifier -->|"selects rules"| node_policy
node_policy -->|"loads policies"| node_builtin
node_verifier -->|"checks citations"| node_citation
node_verifier -->|"checks evidence"| node_required_evidence
node_verifier -->|"checks tools"| node_required_tool
node_verifier -->|"checks restrictions"| node_forbidden
node_verifier -->|"checks conflicts"| node_conflicts
node_verifier -->|"builds decision"| node_result
node_agent -->|"wraps chain"| node_langchain_runnable
node_langchain_runnable -->|"verifies output"| node_runtime
node_agent -.->|"uses middleware"| node_langchain_middleware
node_langchain_middleware -->|"verifies claims"| node_runtime
node_agent -->|"adds guard node"| node_langgraph
node_langgraph -->|"verifies state"| node_runtime
node_caller -->|"posts verification"| node_server
node_server -->|"runs verification"| node_runtime

click node_extract "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/extractors/claims.py"
click node_claim "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/claim.py"
click node_evidence "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/evidence.py"
click node_toolresult "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/tool_result.py"
click node_policy "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/policy.py"
click node_builtin "https://github.com/konoeph/agentclaimguard/tree/main/agentclaimguard/policies"
click node_runtime "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/runtime.py"
click node_verifier "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/verifier.py"
click node_citation "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/validators/citation_binding.py"
click node_required_evidence "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/validators/evidence_required.py"
click node_required_tool "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/validators/tool_required.py"
click node_forbidden "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/validators/forbidden_verdict.py"
click node_conflicts "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/validators/conflict_check.py"
click node_result "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/result.py"
click node_langchain_runnable "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/adapters/langchain/runnable.py"
click node_langchain_middleware "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/adapters/langchain/middleware.py"
click node_langgraph "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/adapters/langgraph/node.py"
click node_server "https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/server/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_extract,node_claim,node_evidence,node_toolresult,node_policy,node_builtin toneBlue
class node_runtime,node_verifier,node_citation,node_required_evidence,node_required_tool,node_forbidden,node_conflicts,node_result toneAmber
class node_langchain_runnable,node_langchain_middleware,node_langgraph toneMint
class node_server toneRose
class node_agent,node_caller toneIndigo
```

## Components

### Inputs and policy

- [Claim extraction](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/extractors/claims.py): `agentclaimguard/extractors/claims.py`
- [Claim model](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/claim.py): `agentclaimguard/core/claim.py`
- [Evidence model](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/evidence.py): `agentclaimguard/core/evidence.py`
- [Tool result model](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/tool_result.py): `agentclaimguard/core/tool_result.py`
- [Policy rules](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/policy.py): `agentclaimguard/core/policy.py`
- [Built-in policies](https://github.com/konoeph/agentclaimguard/tree/main/agentclaimguard/policies): `agentclaimguard/policies`

### Verification engine

- [Guard runtime](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/runtime.py): `agentclaimguard/core/runtime.py`
- [Claim verifier](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/verifier.py): `agentclaimguard/core/verifier.py`
- [Citation binding](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/validators/citation_binding.py): `agentclaimguard/validators/citation_binding.py`
- [Evidence requirements](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/validators/evidence_required.py): `agentclaimguard/validators/evidence_required.py`
- [Tool requirements](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/validators/tool_required.py): `agentclaimguard/validators/tool_required.py`
- [Forbidden verdicts](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/validators/forbidden_verdict.py): `agentclaimguard/validators/forbidden_verdict.py`
- [Conflict detection](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/validators/conflict_check.py): `agentclaimguard/validators/conflict_check.py`
- [Decision and safe output](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/core/result.py): `agentclaimguard/core/result.py`

### Integrations

- [Runnable wrapper](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/adapters/langchain/runnable.py): `agentclaimguard/adapters/langchain/runnable.py`
- [Chain middleware](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/adapters/langchain/middleware.py): `agentclaimguard/adapters/langchain/middleware.py`
- [Graph guard node](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/adapters/langgraph/node.py): `agentclaimguard/adapters/langgraph/node.py`

### HTTP interface

- [HTTP verification API](https://github.com/konoeph/agentclaimguard/blob/main/agentclaimguard/server/main.py): `agentclaimguard/server/main.py`

### Other components

- **Agent workflow**
- **HTTP tool caller**

## Connections

- Agent workflow → Claim extraction: supplies claims (evidence: `README.md`)
- Claim extraction → Claim model: creates claims (evidence: `agentclaimguard/extractors/claims.py`)
- Agent workflow → Guard runtime: submits claims (evidence: `README.md`)
- Guard runtime → Claim verifier: invokes (evidence: `agentclaimguard/core/runtime.py`)
- Claim verifier → Policy rules: selects rules (evidence: `agentclaimguard/core/verifier.py`)
- Policy rules → Built-in policies: loads policies (evidence: `agentclaimguard/core/policy.py`)
- Claim verifier → Citation binding: checks citations (evidence: `agentclaimguard/core/verifier.py`)
- Claim verifier → Evidence requirements: checks evidence (evidence: `agentclaimguard/core/verifier.py`)
- Claim verifier → Tool requirements: checks tools (evidence: `agentclaimguard/core/verifier.py`)
- Claim verifier → Forbidden verdicts: checks restrictions (evidence: `agentclaimguard/core/verifier.py`)
- Claim verifier → Conflict detection: checks conflicts (evidence: `agentclaimguard/core/verifier.py`)
- Claim verifier → Decision and safe output: builds decision (evidence: `agentclaimguard/core/verifier.py`)
- Agent workflow → Runnable wrapper: wraps chain (evidence: `README.md`)
- Runnable wrapper → Guard runtime: verifies output (evidence: `agentclaimguard/adapters/langchain/runnable.py`)
- Agent workflow → Chain middleware: uses middleware (evidence: `README.md`)
- Chain middleware → Guard runtime: verifies claims (evidence: `agentclaimguard/adapters/langchain/middleware.py`)
- Agent workflow → Graph guard node: adds guard node (evidence: `README.md`)
- Graph guard node → Guard runtime: verifies state (evidence: `agentclaimguard/adapters/langgraph/node.py`)
- HTTP tool caller → HTTP verification API: posts verification (evidence: `README.md`)
- HTTP verification API → Guard runtime: runs verification (evidence: `agentclaimguard/server/main.py`)
