Skip to content

lundberga/wickd

Repository files navigation

Wickd

Guardrails for AI agents. Budget limits, kill switches, approval gates, run traces.

One decorator (Python) or wrapper (TypeScript). No framework lock-in.

Let your agents run. We'll keep them honest.

Quick start

Python

pip install wickd
import wickd

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

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

TypeScript

npm install wickd
import { agent, Budget } from "wickd";

const myAgent = agent({
  fn: async (task: string) => {
    const res = await new OpenAI().chat.completions.create({
      model: "gpt-4o",
      messages: [{ role: "user", content: task }],
    });
    return res.choices[0].message.content;
  },
  budget: new Budget({ perRun: 2.0 }),
});

await myAgent.run("Summarise yesterday's support tickets");

What it does

  • Budget rails -- hard cost ceilings (per-run, daily, monthly). Agent dies the moment it exceeds the cap.
  • Approval gates -- pause at sensitive actions (DB writes, emails, payments) and wait for a human.
  • Run traces -- every LLM call, tokens, cost, latency, decision branches. Saved as JSON to ~/.wickd/traces/.

How it works

Wickd monkey-patches LLM SDK client methods (openai.ChatCompletion.create, anthropic.Messages.create, etc.) when an agent run starts. Budget checks happen inside the patched call, before the response reaches your code. Your framework doesn't need to know Wickd is there.

Works with OpenAI, Anthropic, Gemini, LangGraph, CrewAI, Vercel AI SDK -- anything that calls an LLM SDK underneath.

CLI

wickd init              # Scaffold config
wickd traces            # View recent traces
wickd traces --cost     # Sort by cost
wickd approve           # Interactive approval mode
wickd status            # List agents and runs

Project structure

packages/
  core/               Shared trace schema, cost tables, types
  sdk-python/         Python SDK (PyPI: wickd)
  sdk-typescript/     TypeScript SDK (npm: wickd)
apps/
  web/                Next.js dashboard
  docs/               Documentation site
examples/             Framework-specific examples

Contributing

Open an issue first for anything non-trivial.

# Python SDK
cd packages/sdk-python
PYTHONPATH=. python3 -m pytest tests/ -v

# TypeScript (from root)
npm install && npm run build

License

MIT

About

Runtime guardrails for AI agents — budget limits, kill switches, human approval gates, and run traces.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors