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.3.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.3.0-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wickd_ai-0.3.0.tar.gz
  • Upload date:
  • Size: 35.3 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.3.0.tar.gz
Algorithm Hash digest
SHA256 c77e1d4f0402ba4cf8ac45581cd26d94e36cd3ace5b34abe34a632cbd46b348c
MD5 1acf5b63bcdd22666f43a4a5b687a1b5
BLAKE2b-256 729b26b02a1a9fd65e0426c3a81246c696f4a28e73b20aec4edd3d4a0400d722

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: wickd_ai-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 30.0 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d6d936320908fdcf4ebcdee806bd38dffed6033292959bbbd6bc5c573a4a359
MD5 292d326243a55b82aa6a5a0ffb45237b
BLAKE2b-256 e7a1d863dea6be30f7d6db92d7cbcecceb5b9d14759f9862cde6bb80da19724b

See more details on using hashes here.

Provenance

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