Skip to main content

What you’ll build

In ~10 minutes you will:
  • Instrument a function with @guarded_action
  • Produce a local JSONL ledger at .agent-sentinel/ledger.jsonl
  • Connect to the Agent Sentinel cloud platform to view telemetry in real-time
Requirements:
  • Python 3.9+
  • Your agent functions already estimate or know per-call cost (USD) for cost_usd

Step 1: Install the SDK

To enable remote sync (platform uploads), install with:

Step 2: Instrument an action

On the first guarded call you will see:
That is expected here — you have not loaded a policy yet, so nothing is being enforced and every action is permitted. It is logged once per process, and it goes away as soon as you configure a policy. See Policies for budgets, deny lists and rate limits, and set PolicyEngine.set_enforcement_mode("fail_closed") in any deployment where an unconfigured engine should block rather than permit.

Step 3: Inspect the local ledger

By default, Agent Sentinel appends JSON Lines to:
Each line is a full JSON object with action metadata:
Need to change the ledger directory? Set AGENT_SENTINEL_HOME (see Ledger).

Step 4: Connect to the cloud platform

1) Sign up for Agent Sentinel

Visit console.agentsentinel.dev and create an account.

2) Generate an API key

  1. Navigate to SettingsAPI Keys
  2. Click Generate New Key
  3. Copy the key immediately (shown only once)
  4. Store it securely

3) Enable remote sync in your code

4) View telemetry in the web console

  1. Go to console.agentsentinel.dev
  2. Navigate to Runs to see your agent execution
  3. Click into a run to see all actions, costs, and timing
  4. Explore Interventions, Activity Ledger, and Analytics

Next steps

Set up policies

Configure budget limits, denied actions, and rate limits

Add approvals

Require human approval for sensitive actions

Instrument LLMs

Automatically track OpenAI, Anthropic, Grok, or Gemini calls

Web console guide

Learn all the features of the web console