Build Your First Agent
A step-by-step walkthrough. You'll create an agent, give it knowledge, set rules, test it, and check the audit log. Takes about 10 minutes.
Prerequisites
- — A Cadreen account (free tier works)
- — An API key or dashboard access
- — A task you want the agent to handle
What you'll do
Five steps. Click each one to see what happens.
Create an agent
Give it a name and a purpose. The system sets up its knowledge storage, governance, and messaging.
You can create an agent from the dashboard or the API. Here, we'll use the dashboard.
- Go to Agents
- Click Create agent
- Enter a name (e.g., “Support Agent”)
- Enter a purpose (e.g., “Handles customer support questions”)
- Click Create
The agent is now live. It has no knowledge yet, but it's ready to learn.
POST/api/v1/cadreen/agentsAdd knowledge
Knowledge is what an agent remembers. It accumulates from executions, but you can also seed it manually.
After each execution, the agent writes what it learned into knowledge. But you can also add knowledge manually to give it a head start.
Go to your agent's Knowledge tab. You'll see an empty list. Knowledge is added as the agent works. You can also search existing workspace knowledge to see what other agents have learned.
/api/v1/cadreen/agents/{id}/knowledgeSet governance rules
Agent rules control the messages an agent sends to other agents. Workspace rules control its tool calls. The default is permissive: audit everything, block nothing.
Go to your agent's Rules tab. You'll see the default: audit everything, block nothing. This means the agent can do anything, but everything it does is logged.
Agent rules cover the messages an agent sends to other agents. For example, to make a person approve every message this agent sends to another agent:
curl -X POST https://api.cadreen.com/api/v1/cadreen/agents/AGENT_ID/governance \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Approve agent messages", "scope": "agent", "rules": {"require_approval": true}}'The rules it reads are require_approval, blocked_agents, allowed_agents, max_message_length and block_external. To make a person approve a tool call, such as sending an email, add a workspace rule that says what it applies to:
curl -X POST https://api.cadreen.com/api/v1/cadreen/policies \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Email approval", "applies_to": "actions", "actions": ["email"], "rules": [{"condition": "Sending any email", "effect": "require_human_approval"}]}'Then confirm the rule: POST to the approve_url in the answer. From then on, when the agent calls the email tool, the call waits for a person, and you see the request in the dashboard.
An action is the exact name of a tool or a money action. email is the built-in email tool, and it only exists once email sending is set up for Cadreen. If you send email through a connection, use the tool name that connection shows. Cadreen refuses a name it doesn't know and suggests the closest ones.
/api/v1/cadreen/policiesTest with a conversation
Send the agent a message and see how it responds. Watch the audit log to see what it did.
Go to your agent's Messages tab. Type a test message — something in the agent's domain. For a support agent, try “How do I reset my password?”
The agent will respond. Watch the Executions tab to see what tools it called, what knowledge it used, and what it decided. This is the audit trail — every action is logged.
Check the audit log
Everything the agent did is logged. You can see every action, every decision, every message.
Go to your agent's Executions tab. You'll see a list of everything the agent has done. Each entry shows:
- What the agent did (the action)
- What tools it called
- What knowledge it used
- What it decided and why
- When it happened
This is the full audit trail. You can use it to understand the agent's behavior, debug issues, or prove compliance.
What you built
You now have an agent that handles support questions. It has its own knowledge, its own rules, and a full audit trail. As it works, it learns — and those learnings are shared with other agents in your workspace.
Next steps
- Federation Cookbook — Connect your agent to another workspace
- Agents Guide — Learn the full agent lifecycle
- Agent Dashboard — Manage agents visually