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.1.tar.gz (13.5 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.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zocrity-0.1.1.tar.gz
  • Upload date:
  • Size: 13.5 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.1.tar.gz
Algorithm Hash digest
SHA256 b6da89a0764bd8058e8d91adc4c8ff18bc6abdbd2a224b66c6459580f9f8aef1
MD5 da2dcd0523fb25685ae2c13d9bbfb9bb
BLAKE2b-256 bc01bd57c41cee107c8046431713816f11642ce76a84c8e1be69ffd8f86320f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zocrity-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47facca602653bebb4f9957e518d12d477c7e5e32ae3f54e13b4e45d75740234
MD5 abedd32004598667aaea50c7da1c7728
BLAKE2b-256 e24d8226d279e76b2d65f03bd140200b72cd5c4dd60c1704b5755db49e2ed513

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