cyphrex
v0.1.0
Published
Security and identity infrastructure for AI agents
Maintainers
Readme
Cyphrex (JavaScript / TypeScript)
Official SDK for Cyphrex — call check() before every agent action to enforce policies and log violations.
Installation
npm install cyphrexQuick start
import { Cyphrex } from 'cyphrex';
const cyphrex = new Cyphrex({
apiKey: process.env.CYPHREX_API_KEY!,
agentId: 'your-agent-uuid',
// apiUrl optional; defaults to production API
});
const result = await cyphrex.check({
actionType: 'http_call',
url: 'https://api.example.com/data',
});
if (!result.allowed) {
console.error(result.reason, result.violations);
return;
}
// proceed with the actionConstructor
| Option | Required | Description |
|--------|----------|-------------|
| apiKey | Yes | Account API key from Dashboard → API Keys |
| agentId | Yes | UUID of the agent |
| apiUrl | No | API base URL (default: https://cyphrexapi-production.up.railway.app) |
| timeoutMs | No | Request timeout in ms (default: 10000) |
| failOpen | No | If true, allow actions when Cyphrex is unreachable (default: false) |
check(params)
| Param | Type | Description |
|-------|------|-------------|
| actionType | string | e.g. http_call, llm_input, llm_response, data_access |
| url | string? | For http_call |
| payload | any? | Text or object (e.g. LLM prompt snippet) |
| metadata | object? | Optional extra context |
Response (CheckResponse)
allowed: booleanreason?: string— when blocked or errorviolations?: string[]— e.g. severity codesseverity?: string—P1/P2/P3from APIspend?: { amount, currency }— reserved for future use
HTTP
Requests use POST {apiUrl}/v1/check with:
Authorization: Bearer <apiKey>- Body:
{ "agentId": "...", "action": { "type": "...", "url"?, "payload"? } }
Build from source
cd packages/sdk-js && npm install && npm run buildOutput: dist/index.js, dist/index.d.ts.
License
MIT
