Valta Docs
Quickstart
Step 1: Install the SDK
bash
npm install valta-sdk
Step 2: Get your API key
Go to valta.co/dashboard → API Keys → Create Key → copy it.
bash
export VALTA_API_KEY="sk_valta_..."
Never hardcode API keys in source files. Add .env to your .gitignore.
Step 3: Create your first governed agent
ts
import { ValtaClient } from 'valta-sdk'
const valta = new ValtaClient({
apiKey: process.env.VALTA_API_KEY,
})
// Create a governed agent
const agent = await valta.agents.create({
name: 'My First Agent',
description: 'A governed AI agent with spending controls',
})
console.log('Agent created:', agent.id)
console.log('Status:', agent.status)
Step 4: Set a spending policy
ts
await valta.policies.create({
agentId: agent.id,
dailyLimit: 50,
maxPerTransaction: 10,
requireApprovalAbove: 25,
})
console.log('Policy set — agent cannot spend more than $10 per action or $50 per day')
Step 5: Run the agent
ts
const run = await valta.agents.run(agent.id, {
task: 'Check my wallet balance and summarise it in one sentence.',
})
console.log('Status:', run.status) // 'completed'
console.log('Output:', run.summary)
console.log('Duration:', run.durationMs, 'ms')
Step 6: Read the audit trail
ts
const { data: entries } = await valta.audit.list({
agentId: agent.id,
})
console.log('Audit entries:', entries.length)
// Every run, every attempted action, every policy check — all here
You now have a fully governed agent. Every action is logged. Spending is capped. Kill switch available any time:
ts
await valta.agents.freeze(agent.id) // stops all activity immediately
await valta.agents.unfreeze(agent.id) // resume when ready
Next steps
- How Valta Works — architecture and key concepts
- SDK Reference — full method and type documentation
- Spending Policies — configure limits for any use case
- Security — prompt injection defense and API key hygiene