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.4.0.tar.gz (43.8 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.4.0-py3-none-any.whl (33.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wickd_ai-0.4.0.tar.gz
Algorithm Hash digest
SHA256 773d2f7c89418106d48ed3d0abfd79024a5dec2172c88870cdab981ca44322bd
MD5 c48ecce5043c465af90eb9b7050cdce9
BLAKE2b-256 b88c5caf2edced6fb764ad71bf5b4d194c1f847d1f5a3d1922a2a274a3db3774

See more details on using hashes here.

Provenance

The following attestation bundles were made for wickd_ai-0.4.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.4.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for wickd_ai-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d59c2a1903a3602e3875ebeadfcb2b759cc66c1809370826a79436368472e35
MD5 282cf56794e5bc85b8c66e7ce129deea
BLAKE2b-256 cbb8260ca6d4fe4db1ace7d9a2b82801d913b3ef76283b5c18911556bb6177ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for wickd_ai-0.4.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