Skip to content

About

Built by @tristan-nextcz · Portable, evidence-first contract for bounded AI-agent context, authority, and verification.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

Agentic Context Contract

A portable, evidence-first contract for giving AI agents enough operating context to act usefully without turning prompt prose into hidden authority.

Created by Tristan Springmeyer (@tristan-nextcz) and organization-owned by Next Citizen LLC for durable governance.

An agentic context contract makes five things explicit:

  1. the objective and decision;
  2. the sources allowed to establish current truth;
  3. the working state and freshness boundary;
  4. the actions that are and are not authorized; and
  5. the evidence required before the work can be accepted.

The contract is designed for coding, research, operations, and multi-agent handoffs. It is small enough to inspect, structured enough to validate, and independent of any one model or orchestration framework.

Quick start

Validate the included examples with Python 3.11 or later:

python3 scripts/validate_examples.py
python3 -m unittest discover -s tests

No third-party runtime packages are required.

Contract model

Section Question it answers
objective What concrete outcome should this work produce?
decision What decision will the result enable?
source_authority Which sources are authoritative, supporting, or contextual?
working_state What scope, revision, facts, and observation time are current?
authority Which modes and actions are permitted for this contract?
exit_evidence What tests, artifacts, receipts, findings, or verdicts must exist?
trace Which consequential state transitions occurred?
handoff What should the next operator verify before continuing?

See:

Example

{
  "contract_version": "0.1",
  "contract_id": "review-example-service-001",
  "created_at": "2026-07-27T00:00:00Z",
  "objective": "Determine whether the proposed change is ready to merge.",
  "decision": {
    "question": "Should the change merge, be revised, or be blocked?",
    "allowed_outcomes": ["merge", "revise", "block"]
  },
  "source_authority": [
    {
      "id": "worktree",
      "kind": "repository",
      "locator": "/workspace/example-service",
      "authority": "authoritative",
      "observed_at": "2026-07-27T00:00:00Z"
    }
  ],
  "working_state": {
    "scope": "example-service",
    "revision": "0123456789abcdef",
    "observed_at": "2026-07-27T00:00:00Z",
    "facts": ["Target branch is main.", "Review mode is read-only."]
  },
  "authority": {
    "mode": "review",
    "writes_allowed": false,
    "external_actions_allowed": false,
    "destructive_actions_allowed": false,
    "credential_use_allowed": false,
    "prohibitions": ["Do not merge or push."]
  },
  "exit_evidence": [
    {
      "id": "verdict",
      "kind": "verdict",
      "description": "An explicit merge, revise, or block verdict.",
      "required": true
    }
  ]
}

Process intelligence

The contract defines what must be true at the start and end of a bounded unit of work. The optional trace records consequential transitions:

objective -> evidence consulted -> decision -> action -> result -> exception or next state

This is intentionally smaller than a transcript. It preserves the evidence needed to understand why work moved, stalled, or changed authority without recording every token.

Validation

The dependency-free validator checks the supported JSON Schema subset plus cross-field rules:

  • required fields, types, enums, constants, patterns, and additional-property boundaries;
  • timezone-aware RFC 3339 timestamps;
  • expiration after creation;
  • unique source and evidence identifiers; and
  • trace evidence references that resolve to declared exit evidence.

Use any Draft 2020-12 JSON Schema implementation when full schema-engine validation is preferred.

What this does not do

  • It does not grant authority merely because a field says an action is allowed.
  • It does not replace sandboxing, authentication, policy enforcement, or human approval.
  • It does not make a stale source current.
  • It does not require sharing private transcripts.
  • It does not prove that exit evidence is truthful; the receiver must inspect it.

The contract is a portable interface between intent, operating state, authority, and verification. Enforcement remains the responsibility of the systems that consume it.

Related work

Agent Bridge is a local-first CLI and MCP control plane for bounded collaboration across coding-agent tools. Its operating-context field note explains the design principles behind this reference contract.

License

MIT

About

Built by @tristan-nextcz · Portable, evidence-first contract for bounded AI-agent context, authority, and verification.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages