@lupid/agentum-sdk
v0.1.0
Published
TypeScript/JavaScript SDK for the Agentum Agentic IAM platform
Readme
@lupid/agentum-sdk
What is Agentum?
In-process governance for AI agents. The SDK patches your LLM/MCP clients (OpenAI, Anthropic, LangChain, Vercel AI SDK, MCP stdio) to enforce Cedar policies, capture audit trails, and gate tool calls before they execute. v1's enforcement plane is the SDK; the Rust backend provides policy storage, audit ingest, and HITL approvals.
Install
npm install @lupid/agentum-sdkAll peer dependencies are optional (declared in peerDependenciesMeta) — install whichever you use:
openai(≥ 4.0.0)@anthropic-ai/sdk(≥ 0.27.0)@langchain/core(≥ 0.2.0)ai(≥ 3.0.0) — Vercel AI SDKfastify(≥ 4.0.0) — only if using the Fastify integration@nestjs/common(≥ 9.0.0) — only if using the NestJS integration
No Cohere or Gemini SDK peer dep is declared today; those providers are governed via the fetch interceptor only.
Quick start
import { init } from "@lupid/agentum-sdk";
await init({
apiKey: process.env.AGENTUM_API_KEY!,
baseUrl: process.env.AGENTUM_BASE_URL!, // e.g. https://api.agentum.ai
agentName: "my-agent",
});
// From this point, OpenAI / Anthropic / LangChain / Vercel-AI / MCP-stdio
// calls in this process are governed by Agentum policies.init() derives the tenant from the API key server-side; do not pass a tenantId.
Environment variables
| Variable | Required | Default | Purpose |
|---|---|---|---|
| AGENTUM_BASE_URL | yes | — | Gateway URL, e.g. http://localhost:7071. |
| AGENTUM_API_KEY | yes | — | Provisioned via agentum keys create. |
| AGENTUM_AGENT_NAME | yes | — | Stable identifier for this agent. |
| AGENTUM_AGENT_FRAMEWORK | no | agentum-sdk | Reported framework label. |
| AGENTUM_DECLARED_TOOLS | no | — | CSV of tool names declared at register. |
| AGENTUM_DEFAULT_SESSION_ID | no | auto-generated | Pin a default session_id (test/CI). |
| AGENTUM_DEFAULT_USER_ID | no | — | Pin a default user_id for context enrichment. |
Programmatic callers can pass any of these as options to init({...}).
Supported runtimes
- Node ≥ 18 (per
engines.node). - Vercel Edge / Cloudflare Workers / browser environments work via the same
import/requireentries — the package does not declarebrowserorworkerdexport conditions today. Edge-safety is achieved via lazynode:*imports inside the source rather than separate runtime entries. - Node-http interception is Node-only; edge/browser runtimes get fetch-only interception.
- ESM + CJS dual-published.
Known limitations
- Cohere/Gemini streaming response-side enforcement is pre-flight-only today (G-016).
- OpenAI Responses API streaming response-side enforcement is pending (G-017).
- MCP-over-HTTP enforcement is pending (G-018).
- Pre-init detection of LLM clients is advisory (warning only) — call
init()before importing OpenAI/Anthropic clients (G-029). - The endpoint/MITM enforcement plane is out-of-scope for v1 — for hard prevention against a malicious or compromised app, the SDK alone is detection-rich but in-process. See roadmap.
Links
- Homepage: https://github.com/akashsebastian333/agentum
- Issue tracker: https://github.com/akashsebastian333/agentum/issues
- Changelog: ./CHANGELOG.md
