Skip to main content

Budget-Safe AI Agents with Local Caching and Circuit Breakers.

Project description

🛑 Zocrity — The Emergency Brake for AI Agents

Stop API hallucination loops before they drain your budget. Zocrity wraps your agent runs with a hard stop so runaway retries, repeated prompts, and token spirals don’t turn into surprise cloud bills.


🚀 For Replit Users (The 1-Click Install)

If you’re already in this workspace, just hit Fork and you’re basically done.

Then feed your own Agent this exact prompt:

Agent: Look at the zocrity/ folder. Import the shield into my main file, wrap my LLM calls in the @zocrity.guard(budget=2.00) decorator, and add ZOCRITY_MAX_SPEND=5.00 to my Secrets.

🧰 For Local / Non-Replit Users (The Manual Install)

If you’re building outside Replit, just copy the zocrity/ folder into the root of your project and import it like any other package.

Using VS Code or Cursor?

Because this is a Replit-native launch, you should:

  1. Download the zocrity/ folder from this workspace
  2. Drop it into the root of your local project
  3. Add import zocrity wherever your LLM stack starts
  4. Add ZOCRITY_MAX_SPEND to your .env file
ZOCRITY_MAX_SPEND=5.00

✨ Features

  • Thread-safe micro-budgets with zocrity.guard(budget=...)
  • Per-feature tagging with tag="..."
  • Loop detection for repeated prompt spirals
  • Local telemetry for spend tracking and audit trails

🧪 Example

import zocrity

zocrity.shield()

@zocrity.guard(budget=2.00, tag="checkout_flow")
def run_checkout_agent():
    return do_llm_work()

with zocrity.guard(budget=0.50, tag="summary_job"):
    run_llm_summary()

🔒 What It Does

Zocrity watches your agent loops locally and stops them when the budget is hit. It’s built for developers who want guardrails without giving up control.


🏁 That’s It

If your agent spends money, it needs a brake pedal.

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

zocrity-0.1.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

zocrity-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for zocrity-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b84abbcee99aba6b7d99857bb23c67c0eb493df898edb5b37d57bcfce8c04a21
MD5 0b4b541aeef0994c36d73a50fa4c8e64
BLAKE2b-256 51460ce0da6e3bcb7e227d9c34c869f4e15abe2034e9f15ce865d7b8151d769c

See more details on using hashes here.

File details

Details for the file zocrity-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zocrity-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for zocrity-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5198e2e21e869e6816e55d77de5d0653b146a96743615c1b8d3ef8f040e84dc5
MD5 59ae5526c166b9cb5de7bf5ee839fa76
BLAKE2b-256 bf856ddd942abfed2a8913135e99ea0f0abed608e04b7ec6026ca7fbc3947c64

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