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.5.0.tar.gz (52.0 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.5.0-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wickd_ai-0.5.0.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wickd_ai-0.5.0.tar.gz
Algorithm Hash digest
SHA256 37dca9f20fe380fb9e1ee80fdcd968974d75d12d1d25055f4b3fe83173f788f4
MD5 faa2344e706084eac332fd7592ff4587
BLAKE2b-256 5aa8d208a2b4a94ae8d8a1f05b58c53d9328a17d90b585847c1d05cd8c9513c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for wickd_ai-0.5.0.tar.gz:

Publisher: publish.yml on lundberga/wickd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: wickd_ai-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wickd_ai-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc1a399c46e66b02d461249bbeb0e9a1b31496cdce4eb5dbadd38abb3e4e22d2
MD5 e4923176665e48b4d023f90976214d2e
BLAKE2b-256 819c163beb4d41bc7f1e2737bb1d35a2720b2a153522b0957c099c412a7e6d9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for wickd_ai-0.5.0-py3-none-any.whl:

Publisher: publish.yml on lundberga/wickd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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