Skip to main content

Guardrails for AI agents — budget limits, kill switches, and human approval gates.

Project description

wickd

Budget limits, kill switches, and human approval gates for AI agents.

Install

pip install wickd

Quick start

import wickd

@wickd.agent(budget=wickd.Budget(per_run=2.00, daily=20.00))
def my_agent(task: str):
    import openai
    client = openai.OpenAI()
    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": task}]
    )
    return response.choices[0].message.content

my_agent.run("Summarise yesterday's support tickets")

One decorator. Your agent now has a hard cost cap, full run tracing, and a summary after every run:

[wickd] ✓ my_agent | $0.0043 cost | 1 calls | budget: $0.0043/$2.00 | 1203ms | trace: a1b2c3d4

Budget enforcement

Hard cost ceilings, enforced in real time. When a cap is hit, execution stops immediately.

@wickd.agent(
    budget=wickd.Budget(
        per_run=2.00,    # kill if this run exceeds $2
        daily=20.00,     # kill if today's total exceeds $20
        monthly=500.00,  # kill if this month exceeds $500
    ),
    on_budget_kill=wickd.notify.slack("https://hooks.slack.com/..."),
)
def my_agent(task: str):
    ...
try:
    my_agent.run("Process all invoices")
except wickd.BudgetExceeded as e:
    print(f"Killed at ${e.spent:.2f}")

Approval gates

Pause execution at sensitive checkpoints and wait for human approval.

@wickd.approval("database_write")
def update_user_record(user_id, data):
    db.update(user_id, data)

@wickd.agent(budget=wickd.Budget(per_run=5.00))
def support_agent(task: str):
    # ...agent logic...
    update_user_record("user_123", {"email": "new@example.com"})  # pauses here

The agent pauses, prompts for approve/deny, and continues or aborts.

Traces

Every run is traced automatically.

wickd traces            # list recent
wickd traces --cost     # sort by cost
wickd traces a1b2c3d4   # detail view

Notifications

on_budget_kill=wickd.notify.console()                              # local dev
on_budget_kill=wickd.notify.slack("https://hooks.slack.com/...")    # slack
on_budget_kill=wickd.notify.webhook("https://your-api.com/alerts") # any webhook

Supported SDKs

Wickd intercepts calls from OpenAI, Anthropic, and Google GenAI SDKs automatically. No code changes needed beyond the @wickd.agent() decorator.

How it works

  1. @wickd.agent() wraps your function
  2. Wickd patches the LLM SDKs to intercept every API call
  3. Token usage and cost are tracked in real time
  4. If cost exceeds the budget, execution is killed immediately
  5. @wickd.approval() functions pause for human approval
  6. A full trace is saved locally after every run

Everything runs locally. No data leaves your machine.

License

MIT

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

wickd_ai-0.1.0.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

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

wickd_ai-0.1.0-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wickd_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c5d56ed4c75b6c1005f272669f9004fbee64175ba4d3f3feb39241adb34ede4e
MD5 ee18615163d64e97d30b843117bf0c61
BLAKE2b-256 f3b7db30f864fffb9933590cfb4bd00759a0614d554a16aa3f96cb0a23727955

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wickd_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe5c50167137327b7e76112c240fb21e0c8fc16ed0612bb94cf2f2e6e01f4c6e
MD5 745f70ed8f8814b7a4d3414b0c6531e5
BLAKE2b-256 ccb09d30d6a3698eaa6d75e64c93b4554bb3cc03198745a9e37c45ae4f0967fd

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