Agents, governed.

Run agents with rules the model can't rewrite, approvals from the people you choose, budgets that cap what they spend, and a record of everything they did.

Install

def deps do
  [
    {:wardrik, "~> 0.1.0-rc.1"}
  ]
end

Start it

Define a module that uses Wardrik, configure it, and add it to your supervision tree:

defmodule MyApp.AgentRuntime do
  use Wardrik, otp_app: :my_app
end

# config/runtime.exs
config :my_app, MyApp.AgentRuntime,
  store: {WardrikStore.EKV, data_dir: "/var/lib/my_app"},
  policy: [deny: ["shell/*"]]

# application.ex
children = [MyApp.AgentRuntime]

Then act as someone, and talk to agents:

scope = MyApp.AgentRuntime.as("acme/@maria", roles: [:owner], resources: ["acme/@maria/*"])

{:ok, notes_agent} =
  Wardrik.Agent.define(scope, "acme/@maria/assistant",
    model: "anthropic:claude-haiku-4-5",
    instructions: "You keep Maria's notes.",
    policy: [budget: [usd: 1.00, per: :day]]
  )

Wardrik.Agent.reply(scope, notes_agent, "What did I note yesterday?")
#=> {:ok, %Wardrik.Reply{message: "msg_Xq3f...", run: "0af76519...", text: "You noted the Q3 numbers..."}}

Or Stream the results:


scope
|> Wardrik.Agent.stream(notes_agent, "Summarize yesterday's notes.")
|> Enum.each(&IO.write/1)

See it in action

Start with Wardrik in ten minutes: an agent that looks up orders, asks before it refunds, keeps a record and stops at its budget. Each notebook runs in Livebook.

Guides

  • Run Wardrik: the instance module, its options, where agents are kept, and its nodes.
  • Talk to agents: asking, streaming answers, and replies.
  • Define agents: what agents are and may do, as data, and how they sleep and wake.
  • Trigger agents: asking agents on a clock, from a feed, or from a webhook.
  • Policies: rules the model can't rewrite, held at once by the deployment and each agent, and budgets.
  • Who may do what: scopes, grants and roles, API tokens, and your own authorizer.
  • Operations: every operation as a function, taking and answering structs.
  • Approvals: deciding the calls agents wait on.
  • MCP servers: the servers agents call, those Wardrik starts with and those an org or person adds as it runs.
  • Credentials and sign-ins: sealed credentials, and people signing in to give agents their accounts.
  • Events and the audit: following what agents do into your app, and what people did.
  • Over HTTP: every operation as a route, with wardrik_http.

License

Apache-2.0