Skip to main content

argox — Python SDK

pip install argox

For agents that aren't Claude Code (LangChain tools, OpenAI Agents SDK, a homegrown loop) and so have no PreToolUse/PostToolUse hook mechanism to plug into. Wrap your own tool calls with two lines:

import argox as at

def write_file(path, content):
    result = at.check("write_file", path)
    if not result.allowed:
        raise PermissionError(result.reason)

    output = _actually_write(path, content)

    at.record_output("write_file", path, output)
    return output

action is a generic verb -- read_file / write_file / run_shell / call_api get real policy rules (path denylist, dangerous shell detection, taint-based secret/PII exfil checks). Any other string still gets a decision back (default-allow), just without a verb-specific rule.

Config

Reads ARGOX_API_KEY (the same key argox connect writes for Claude Code) and optionally ARGOX_API_BASE from the environment, or pass them explicitly:

at.configure(api_key="...", api_base="https://your-instance")

Sessions

Pass the same session_id across an agent run's tool calls to group them into one session/trace on the dashboard, and so later check() calls inherit taint tags absorbed by earlier record_output() calls (e.g. a call_api right after a read_file that returned a secret gets flagged even though the call itself looks benign in isolation). Omit it and each call is treated as its own session.

Errors vs. denials

A policy "deny" is a normal, successful check() result (result.allowed is False) -- not an exception. ArgoxError is only raised for auth/network/protocol failures talking to the backend itself. check() never raises on a deny, so callers must check .allowed.

Release files for argox 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for argox 0.2.1
File Size Uploaded
argox-0.2.1.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for argox 0.2.1
File Interpreter ABI Platform
argox-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / argox-0.2.1.tar.gz

Download URL argox-0.2.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7446bf81d3e023285605c99ed53d34bc95c075faf528ea7ae58ad63a319b4394
BLAKE2b-256 checksum
How to use checksums
c8d1e8fc2d5d84794e4a6427da7a09665d1d59997be799b3f6ef6096b291d38f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / argox-0.2.1-py3-none-any.whl

Download URL argox-0.2.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72b65d648de686d2d6f1cb6c70a41883b3583a704bed7b59e44b7027772cc7fa
BLAKE2b-256 checksum
How to use checksums
eea6f6a0e69c14f47b43413da883be811897be291644787076f09a70e4971ea7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page