Skip to content

API Reference parrot.security.groundedness.policy

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.security.groundedness.policy

View source

Policy and report models for deterministic groundedness scoring.

Defines the per-agent GroundednessPolicy, the per-atom AtomVerdict, and the aggregate GroundednessReport (FEAT-398, spec §2 Data Models).

Alias Atom

Re-exported from parrot.security.groundedness.models.Atom.

Alias AtomKind

Re-exported from parrot.security.groundedness.models.AtomKind.

Class AtomVerdict

A per-atom groundedness verdict.

Fields:

Field Type Default Description
atom Atom The answer atom being verified.
verdict Literal['supported', 'contradicted', 'unsupported'] supported / contradicted / unsupported.
nearest_evidence str | None None The closest evidence candidate's raw text (contradicted only) — diagnostic aid.

Class GroundednessPolicy

Per-agent groundedness scoring policy.

Scoring-only — there is no enforce mode; every knob here tunes classification, never mutation/blocking of the response.

Fields:

Field Type Default Description
enabled_kinds list[AtomKind] Atom kinds to extract. Default: all five.
include_user_prompt_as_evidence bool True Treat the user's question as legitimate evidence (agent echoing a user-stated figure).
contradicted_band float 0.15 Upper relative delta for "contradicted" (same-magnitude) classification.
min_alert_score float 0.8 Below this, telemetry marks the turn flagged. Score is always emitted regardless.
max_evidence_bytes int 262144 Evidence-index input cap.
min_number_digits int 4 Bare integers shorter than this are skipped (noise floor).

Class GroundednessReport

Aggregate groundedness report for one turn's final answer.

Fields:

Field Type Default Description
score float supported / total_atoms; 1.0 when there are no atoms to check (no_factual_content) or no evidence (no_evidence).
total_atoms int Total answer atoms scored.
supported list[AtomVerdict] Atoms matched (exactly or within precision tolerance).
contradicted list[AtomVerdict] Same-magnitude atoms outside stated precision but within contradicted_band.
unsupported list[AtomVerdict] Atoms with no trace in evidence.
no_factual_content bool False True when the answer had no verifiable atoms.
no_evidence bool False True when the turn had no tool-call results.
evidence_truncated bool False True when max_evidence_bytes was hit while building the evidence index.
duration_ms float 0.0 Wall-clock scoring time. Excluded from model_dump/model_dump_json by default so identical (answer, evidence) inputs produce byte-identical serialized reports (spec §5 determinism criterion) regardless of timing jitter; still directly readable via report.duration_ms.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally