Getting Started

Quickstart

Go from zero to a scored agent in under five minutes. This guide uses the Credian CLI, which ships with the SDK.

1. Install the SDK

Credian ships as a single npm package with zero runtime dependencies. Requires Node 18+.

Terminal
$ npm install credian

2. Log in

Credian uses OAuth2 device-code login — there is no email/password signup. login opens a browser to authenticate you, then mints an agent and an API key and saves them locally.

Terminal
$ npx credian login
To authorize this device, visit:
https://credian.io/device
and enter the code: WDJB-MJHT
Waiting for approval...
Logged in. Agent created.
Agent ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
SID: SID-0xA3F7B2C891D4E6F0
Credentials saved to ~/.credian/config.json

3. Check your identity

Verify the CLI can authenticate with your saved credentials.

Terminal
$ npx credian whoami
Agent ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Display Name: invoice-processor-prod
Status: active

4. Give your agent a mandate

A mandate declares which actions an agent is allowed to take. Until an agent has an active mandate, authorize.check blocks every action. Creating a mandate is an owner action — do it in the dashboard, or with an owner-authenticated SDK client.

mandate.ts
import { Credian } from 'credian';
// Owner token, not the agent API key — mandates are owner-scoped.
const credian = new Credian({ accessToken: process.env.CREDIAN_OWNER_TOKEN });
await credian.mandates.create(agentId, {
purpose: 'Processes vendor invoices and pays approved ones',
allowedActions: ['api.read', 'api.write', 'payment.send'],
limits: { maxAmountCents: 100_000 },
});

Read the active mandate any time with credian.mandates.getActive(agentId).

5. Build trust through the gateway

Trust is earned from what Credian observes, not from what an agent says about itself. Route your agent's outbound API calls through credian.proxy.fetch — Credian witnesses each call and accrues gateway-observed evidence that moves the score.

agent.ts
const res = await credian.proxy.fetch({
url: 'https://api.openai.com/v1/chat/completions',
method: 'POST',
intent: 'api.write',
headers: { Authorization: `Bearer ${OPENAI_API_KEY}` },
body: JSON.stringify({ model: 'gpt-4o-mini', messages }),
});

Self-reported events (events.reportSelf) are logged for your own audit trail but do not move the score. Only Credian-observed evidence does.

6. Check your score

View your current trust score and its dimension breakdown.

Terminal
$ npx credian score
Agent: invoice-processor-prod (SID-0xA3F7B2C891D4E6F0)
Overall Score: 512/1000
Tier: fair
Confidence: medium
Breakdown:
Execution Reliability: 740/1000
Outcome Quality: not assessed yet
Identity: 94/1000

Next steps

  • SDK Reference — Use the TypeScript SDK in your application code.
  • Events — See all event types and how they affect scoring.
  • Integrations — Connect Credian to LangChain, CrewAI, or Vercel AI SDK.