Skip to main content

Reference validation CLI for the AgentOBS event standard

Project description

agentobs-validate

Reference validation CLI and Python SDK for the AgentOBS event standard.

CI


Overview

agentobs-validate validates JSON or JSONL event streams against the AgentOBS schema. It can be used as a CLI tool for CI pipelines or as a Python library for programmatic validation.

If an event stream passes validation, it is considered AgentOBS compliant.


Installation

pip install agentobs-validate

For development:

git clone https://github.com/veerarag1973/AgentOBSValidate.git
cd AgentOBSValidate
pip install -e ".[dev]"

Quick Start — CLI

# Validate a JSONL stream
agentobs-validate events.jsonl

# Validate a JSON array
agentobs-validate events.json

# JSON output for CI / downstream scripts
agentobs-validate events.jsonl --json

# Read from STDIN
cat events.jsonl | agentobs-validate

# OpenTelemetry compatibility: accept camelCase field names
agentobs-validate events.jsonl --otel

# Pin to a specific schema version
agentobs-validate events.jsonl --schema-version 0.1

# Cryptographic HMAC-SHA256 signature verification
agentobs-validate events.jsonl --key-file signing.key

# Export the AgentOBS event JSON Schema (Draft 2020-12)
agentobs-validate --export-schema > agentobs-schema.json

Quick Start — Python SDK

from agentobs_validate.validator.engine import validate_event, validate_stream
from agentobs_validate.validator.input_parser import iter_events
from agentobs_validate.validator.context import ValidationContext

# Validate a single dict
result = validate_event(1, {
    "event_id": "01HZQSN7PQVR2K4M0BXJD3GSTA",
    "timestamp": "2026-03-06T10:00:00.000Z",
    "event_type": "agent.plan.created",
    "source": "spanforge@1.0.0",
    "trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
    "span_id": "00f067aa0ba902b7",
})
print(result.status)  # "pass"

# Validate a JSONL file
result = validate_stream(iter_events("events.jsonl"))
print(f"{result.valid}/{result.events_checked} valid")

# OTel mode + HMAC key
ctx = ValidationContext(otel_mode=True, key_bytes=open("signing.key", "rb").read().rstrip())
result = validate_stream(iter_events("events.jsonl"), ctx)

Exit Codes

Code Meaning
0 All events valid
1 Validation errors present
2 Input parse or configuration error
3 Internal validator error

Documentation

Document Description
docs/tutorial.md Step-by-step CLI and SDK tutorial
docs/sdk.md Full Python SDK API reference
docs/errors.md Error code reference
docs/ci.md CI integration guide (GitHub Actions, GitLab, CircleCI)
docs/performance.md Benchmark results and performance notes
agentobsvalidatespec.md Full specification

Running Tests

pytest

Targets ≥95% coverage. Current: 100% across 639 tests.


Status

v1.0.0 — Fully implemented. All validation features complete including OTel compatibility, HMAC-SHA256 signature verification, JSON Schema export, and schema version negotiation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentobs_validate-1.0.0.tar.gz (43.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentobs_validate-1.0.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file agentobs_validate-1.0.0.tar.gz.

File metadata

  • Download URL: agentobs_validate-1.0.0.tar.gz
  • Upload date:
  • Size: 43.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for agentobs_validate-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3b72e5747240d4e759a014c3ad787c62c5221392645104ccd262c7ec595c4762
MD5 2c025b07e2ed4665b58cfdf2082d3692
BLAKE2b-256 4834c3583c93a8454636c548b68f973b90924b12ab2f01beaea41295387f0e4c

See more details on using hashes here.

File details

Details for the file agentobs_validate-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentobs_validate-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73243854fb3d659077cbba4bbda63d927031120862c18eb83a63d6da5cd5ea89
MD5 207002c0bdaf1d3e765b782a8725ae74
BLAKE2b-256 684a0797a777b6014d9aa622ed5b5c85504554cb94b4f6bf9ebb6cdd0ed57cf9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page