Skip to content

Models

Core data models for actions, constraints, and verification results. All models are Pydantic v2 with frozen=True.

Module: munio.models


An agent tool call to be verified.

This is the input to the verification pipeline. Every framework adapter (LangChain, CrewAI, ADK, MCP) normalizes its tool call into this model.

Fields:

NameTypeDescription
toolstr
argsdict[str, Any]
agent_id`strNone`
metadatadict[str, Any]

A single safety constraint loaded from YAML.

Maps to OWASP Agentic Top 10 categories (ASI01-ASI10). Tier is auto-detected from check type if not specified.

Action pattern matching uses fnmatch (glob) syntax:

  • "*" matches any action (default).
  • "http_request" matches exactly "http_request".
  • "http_*" matches "http_request", "http_get", etc.
  • "*.read" matches "db.read", "file.read", etc.

Fields:

NameTypeDescription
namestr
descriptionstr
categorystr
tierTier
actionstr
actions`list[str]None`
check`ConstraintCheckNone`
deploy_check`DeployCheckNone`
conditionslist[ConstraintCondition]
on_violationOnViolation
severityViolationSeverity
enabledbool

Top-level configuration for munio.

Loaded from .munio.yaml or CLI flags. Use model_copy(update={...}) to derive modified configs.

Mode vs on_violation resolution:

  • DISABLED mode: skip all checks, return allowed=True immediately.
  • SHADOW mode: run all checks, always return allowed=True (global override).
  • ENFORCE mode: per-constraint on_violation applies:
    • BLOCK: violation blocks the action (allowed=False).
    • WARN: violation logged, action allowed (allowed=True).
    • SHADOW: same as WARN for that individual constraint.

Fields:

NameTypeDescription
modeVerificationMode
constraints_dirPath
constraint_packslist[str]
default_on_unmatchedOnViolation
solverSolverConfig
include_violation_valuesbool
max_violation_value_lengthint

The check definition inside a constraint.

Determines WHAT to check and HOW.

Fields:

NameTypeDescription
typeCheckType
fieldstr
valueslist[str]
patternslist[str]
matchMatchMode
case_sensitivebool
min`floatNone`
max`floatNone`
unit`strNone`
variablesdict[str, CompositeVariable]
expressionstr
window_seconds`floatNone`
max_count`intNone`
stepslist[str]
scopeLiteral['global', 'agent']

Result of verifying an action against a constraint set.

This is the primary output of the verification pipeline.

Fields:

NameTypeDescription
allowedbool
modeVerificationMode
violationslist[Violation]
checked_constraintsint
elapsed_msfloat
tier_breakdowndict[str, int]
timestampdatetime
has_violationsboolWhether any violations were found, regardless of mode.

A single constraint violation found during verification.

Fields:

NameTypeDescription
constraint_namestr
constraint_categorystr
severityViolationSeverity
messagestr
fieldstr
actual_valuestr
tierTier
sourceViolationSource

What to do when a constraint is violated.

Fields:

NameTypeDescription
BLOCK
WARN
SHADOW

Values:

  • BLOCK = 'block'
  • WARN = 'warn'
  • SHADOW = 'shadow'

How the guard behaves on violation.

Fields:

NameTypeDescription
ENFORCE
SHADOW
DISABLED

Values:

  • ENFORCE = 'enforce'
  • SHADOW = 'shadow'
  • DISABLED = 'disabled'

Verification tier — determines which backend handles the check.

Fields:

NameTypeDescription
TIER_1
TIER_2
TIER_3
TIER_4

Values:

  • TIER_1 = 1
  • TIER_2 = 2
  • TIER_3 = 3
  • TIER_4 = 4

Auto-generated from source code. Do not edit manually.