Quickstart
Set up your first Strattum connector, write a policy, and run a governed context query. Estimated time: 15 minutes.
Prerequisites
- Node.js 18+ or Python 3.9+
- A Strattum account (Starter tier is free)
- Access credentials for one of the supported data sources
Install the Strattum client
Install the Strattum SDK using your package manager.
# Install via npm
npm install @strattumx/client
# Authenticate with your API key
npx strattum auth login
After login, your API key is stored locally in ~/.strattum/credentials. You can also set STRATTUM_API_KEY as an environment variable in CI environments.
Register a connector
Register your first connector by providing the data source configuration. This example uses PostgreSQL. The connector credential is stored in the Strattum vault and never exposed in your application code.
{
"connector": {
"id": "prod-postgres",
"type": "postgresql",
"host": "db.internal.company.com",
"port": 5432,
"database": "analytics",
"schema": "public"
}
}
# Register connector and store credentials in vault
npx strattum connector register strattum.config.json \
--credential DB_USER=analytics_ro \
--credential DB_PASSWORD=$DB_PASSWORD
# Verify connectivity
npx strattum connector test prod-postgres
Write an access policy
Policies define what each agent can access. The policy below allows the agent identified by the reporting-agent key to query the orders and customers tables in your PostgreSQL connector, with the customer_ssn field explicitly excluded.
version: "1.0"
policy_id: reporting-agent-v1
agent:
key_id: reporting-agent
rules:
- allow:
connector: prod-postgres
tables: [orders, customers]
exclude_fields: [customer_ssn]
# Deploy the policy
npx strattum policy deploy policy.yaml
# Confirm it is active
npx strattum policy list
Run your first context query
With the connector registered and the policy deployed, send a context query from your agent. The SDK resolves the agent key automatically from the environment variable or credentials file.
import { StrattumClient } from '@strattumx/client';
const client = new StrattumClient();
const result = await client.query({
connector: 'prod-postgres',
table: 'orders',
filters: {
status: 'pending',
created_after: '2026-01-01'
},
limit: 50
});
console.log(result.rows);
console.log(result.audit_event_id);
Every successful query returns an audit_event_id alongside the data. This ID references the audit log entry for that query. Keep it in your application logs to correlate application-level events with the Strattum audit trail.
Inspect the audit dashboard
After running your first query, the audit log entry is immediately visible in the Strattum dashboard. Each entry shows the agent key, the connector and table queried, the policy rule that resolved the request, and the query timestamp.
# List recent audit events via CLI
npx strattum audit events --limit 5
# Output:
# EVENT_ID AGENT CONNECTOR STATUS TIMESTAMP
# evt_9c2a14b reporting-agent prod-postgres ALLOWED 2026-07-10T14:32:07.441Z