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
Step 2: Instrument an action
impact="read" is there on purpose: since 0.4.0 the SDK blocks unconfigured
actions of impact medium/high (the default) by default. search_web only
queries and returns results, so it declares itself as a read. Anything that
writes needs a policy configured (see Policies) or the
AGENT_SENTINEL_ENFORCEMENT=fail_open escape hatch.
On the first guarded call you will see:That is expected here — you have not loaded a policy yet, but
search_web is
declared impact="read", so it is still permitted under the default
fail_closed_writes enforcement mode. 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. An
action declared impact="medium" or "high" (a write) would instead raise
NoPolicyForWriteError until a policy is loaded.Step 3: Inspect the local ledger
By default, Agent Sentinel appends JSON Lines to: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
- Navigate to Settings → API Keys
- Click Generate New Key
- Copy the key immediately (shown only once)
- Store it securely
3) Enable remote sync in your code
4) View telemetry in the web console
- Go to console.agentsentinel.dev
- Navigate to Runs to see your agent execution
- Click into a run to see all actions, costs, and timing
- 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
