Skip to main content

chronos-gateway

The Python client for Chronos Gateway: AI agents change your Postgres only through checked, approved merges. Each agent task is a run for one tenant, working in its own copy of your data; its merge lands when your rules allow it, or waits for a person to approve it. Standard library only, Python 3.9+.

pip install chronos-gateway
from chronos_gateway import Gateway

gw = Gateway("https://gateway.example.com", key=os.environ["CHRONOS_GATEWAY_KEY"])
with gw.run(tenant=user.org_id, intent="clean up duplicate leads", end_user=user.id) as run:
    agent.tools = run.openai_tools()          # or run.mcp_server() for MCP clients
    agent.invoke(task)
    result = run.propose()
if result.held:
    link = gw.approval(run.id, end_user=user.id)   # show link.html (the <chronos-approve> widget) to the user
  • AsyncGateway runs the same calls for asyncio code.
  • A person approves a part (gw.approve(run.id, only_keys=["leads/7"])), or a link only one person, signed in, can use (gw.approval(run.id, approver="bo@acme.com")).
  • A held run whose reads changed since it began raises GatewayError with code reads_changed (its body says what changed); a person who decides to merge it anyway: gw.approve(run.id, skip_read_check=True).
  • The rules, keys and masks: policy / set_policy, keys / create_key / revoke_key, masks / set_masks; events(last=20) for what happened lately.
  • chronos_gateway.adapters: the run's tools for LangChain and LangGraph, the Claude Agent SDK and the OpenAI Agents SDK (each needs its framework installed).
  • A pytest fixture, chronos_run: a run discarded after the test (set CHRONOS_GATEWAY_URL, CHRONOS_GATEWAY_KEY and CHRONOS_GATEWAY_TENANT).
  • verify_signature checks a webhook delivery's Chronos-Signature.

The gateway itself is chronos-gateway, which you run beside your Postgres (or link to Chronos Cloud).

Metadata

Release files for chronos-gateway 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 chronos-gateway 0.2.1
File Size Uploaded Provenance Actions
chronos_gateway-0.2.1.tar.gz 11.0 kB Without provenance Details for chronos_gateway-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 20.6 kB

Release files / chronos_gateway-0.2.1.tar.gz

Download URL chronos_gateway-0.2.1.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3ffe4d6eaf60e938f7d3ddd675fce8c59e9e73c717c08ab88781c485d441264b
BLAKE2b-256 checksum
How to use checksums
8dda6213d5c8a07ba934c29c95c36291fd4cbfccbb40eb9bc06bd25a7762ac9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

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

Download URL chronos_gateway-0.2.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a762c0292cf5c4ad352528fef5ff799742a4307ca9c54f3a2d20d2cc39b8a5d7
BLAKE2b-256 checksum
How to use checksums
3ab914fb6f86de3e749dfe48c6904c4d13b29c4c0da5a3bdf911a691a13b9ebe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for chronos-gateway 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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