Skip to main content

Python bindings for Axiom - a verification-first policy engine for AI agents

Project description

axiom-py

Python bindings for Axiom — a verification-first policy engine for AI agents.

Installation

pip install axiom-lang

Or build from source:

cd axiom_py
pip install maturin
maturin develop

Quick Start

from axiom import AxiomEngine

# Load a policy file
engine = AxiomEngine.from_file("security.axm")

# Verify an intent
verdict = engine.verify("WriteFile", {
    "path": "/tmp/test.txt",
    "content": "hello world"
})

if verdict.allowed:
    print("Action permitted")
else:
    print(f"Denied: {verdict.reason}")

API Reference

AxiomEngine

The main policy engine class.

Class Methods

  • AxiomEngine.from_file(path: str) -> AxiomEngine

    • Load a policy from a .axm file
  • AxiomEngine.from_source(source: str) -> AxiomEngine

    • Load a policy from source code string

Methods

  • verify(intent_name: str, fields: dict) -> Verdict

    • Verify an intent against the policy
    • Pure operation - no side effects
  • intents() -> list[str]

    • Get all intent names in the policy
  • intent_signature(name: str) -> IntentSignature | None

    • Get metadata about an intent
  • has_intent(name: str) -> bool

    • Check if an intent exists

Verdict

Result of a verification operation.

Attributes

  • allowed: bool — Whether the intent is permitted
  • reason: str | None — Reason for denial (None if allowed)
  • guidance: str — Human-readable guidance
  • category: str — Policy decision category

IntentSignature

Metadata about an intent.

Attributes

  • name: str — Intent name
  • takes: list[tuple[str, str]] — Input parameters (name, type)
  • gives: list[tuple[str, str]] — Output parameters (name, type)
  • effect: str — Effect class (READ, WRITE, NETWORK, etc.)
  • conscience: list[str] — Applicable conscience predicates

Module Functions

  • verify(policy_path: str, intent_name: str, fields: dict) -> Verdict

    • One-shot verification helper
  • version() -> str

    • Get version information

Example Policy

module security {
    intent ReadFile {
        takes:   path: String;
        gives:   content: String;
        effect:  READ;
        conscience: path_safety;
    }

    intent WriteFile {
        takes:   path: String, content: String;
        gives:   success: bool;
        effect:  WRITE;
        conscience: path_safety, no_exfiltrate;
    }
}

License

Apache-2.0

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

axiom_lang-0.1.0.tar.gz (180.5 kB view details)

Uploaded Source

Built Distribution

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

axiom_lang-0.1.0-cp312-abi3-manylinux_2_34_x86_64.whl (752.8 kB view details)

Uploaded CPython 3.12+manylinux: glibc 2.34+ x86-64

File details

Details for the file axiom_lang-0.1.0.tar.gz.

File metadata

  • Download URL: axiom_lang-0.1.0.tar.gz
  • Upload date:
  • Size: 180.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for axiom_lang-0.1.0.tar.gz
Algorithm Hash digest
SHA256 408fcb56809dd949dced7efaf7c3e4c952434b6e12b279e24e644de57aa5d7f9
MD5 fdd6558c35263dc4b8b4d9ef76e479ae
BLAKE2b-256 9056c1b35b41fc3594c4f0b24b47bc57d64a43dc7505c3fb7d917579df2fc74f

See more details on using hashes here.

File details

Details for the file axiom_lang-0.1.0-cp312-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for axiom_lang-0.1.0-cp312-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ca39fd1a7dd0aab2530befdf7d99eb9d3234b79ffa6c96e8e51340988de32627
MD5 893a803e1c8a6ab5b3c0e8ea4088cf12
BLAKE2b-256 064e4a899f109c78cdc9994abeac938274840c2503d1a344f46830dfb1adcd5b

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