What You Can Build

30 real-world products and SaaS applications you can build entirely with @elsium-ai/* packages — no additional AI framework dependencies needed.


AI Platforms & Infrastructure

1. AI Gateway / LLM Proxy

A centralized proxy that sits between your apps and LLM providers. Route requests to the cheapest or fastest provider automatically, cache repeated queries, enforce budgets, and get a single bill across Anthropic, OpenAI, and Google.

Uses: gateway, createProviderMesh, cacheMiddleware, costTrackingMiddleware, createCostEngine, rateLimitMiddleware, authMiddleware

import { gateway } from '@elsium-ai/gateway'
import { createProviderMesh } from '@elsium-ai/gateway'
import { cacheMiddleware, costTrackingMiddleware, rateLimitMiddleware } from '@elsium-ai/gateway'

const mesh = createProviderMesh({
  providers: [
    { name: 'anthropic', config: { apiKey: env('ANTHROPIC_API_KEY') }, priority: 1 },
    { name: 'openai', config: { apiKey: env('OPENAI_API_KEY') }, priority: 2 },
    { name: 'google', config: { apiKey: env('GOOGLE_API_KEY') }, priority: 3 },
  ],
  strategy: 'cost-optimized',
  middleware: [cacheMiddleware(), costTrackingMiddleware(), rateLimitMiddleware({ rpm: 1000 })],
})

2. Multi-Tenant AI API Platform

A hosted API where each customer gets their own API key, usage limits, and model access. Think “Stripe for AI” — customers sign up, get keys, and call your endpoints with per-tenant billing.

Uses: createApp, tenantMiddleware, tenantRateLimitMiddleware, createRBAC, authMiddleware, costTrackingMiddleware, createRoutes, createClient

import { createApp, createRoutes } from '@elsium-ai/app'
import { createRBAC } from '@elsium-ai/app'

const rbac = createRBAC({
  roles: [
    { name: 'free', permissions: ['model:use:gpt-4o-mini'], inherits: [] },
    { name: 'pro', permissions: ['model:use:*'], inherits: ['free'] },
  ],
})

const app = createApp({
  middleware: [authMiddleware(), tenantMiddleware(), costTrackingMiddleware()],
  routes: createRoutes({ rbac }),
})

3. AI Observability Dashboard

A monitoring platform that tracks every LLM call across your org — latency, cost, token usage, error rates, traces. Alert on anomalies, suggest cheaper models, detect cost spikes.

Uses: observe, createSpan, createMetrics, createCostEngine, createOTLPExporter, createProvenanceTracker, registerModelTier

import { createSpan, createMetrics, createOTLPExporter } from '@elsium-ai/observe'
import { createCostEngine } from '@elsium-ai/gateway'

const metrics = createMetrics()
const exporter = createOTLPExporter({ endpoint: 'https://otel.example.com' })

const span = createSpan('llm-call', { model: 'claude-sonnet-4-6' })
const cost = createCostEngine()
cost.on('threshold', (event) => alert(`Cost spike: $${event.total}`))

4. Prompt Management Platform

A versioned prompt registry where teams collaborate on prompts, run A/B tests between variants, track which prompts perform best, and detect regressions when prompts change.

Uses: createPromptRegistry, definePrompt, createExperiment, runEvalSuite, assertDeterministic, assertStable, createRegressionSuite, pinOutput

import { createPromptRegistry, definePrompt } from '@elsium-ai/testing'
import { createExperiment, runEvalSuite } from '@elsium-ai/testing'

const registry = createPromptRegistry()
const prompt = definePrompt('classify-ticket', {
  template: 'Classify this support ticket: {{ticket}}',
  version: '1.2.0',
})

const experiment = createExperiment({
  variants: [prompt.v('1.1.0'), prompt.v('1.2.0')],
  evalSuite: runEvalSuite({ metrics: ['accuracy', 'latency', 'cost'] }),
})

5. AI Cost Intelligence Platform

Track and optimize AI spend across teams and projects. Set per-team budgets, project cost projections, detect runaway loops, and get recommendations on cheaper model alternatives.

Uses: createCostEngine, costTrackingMiddleware, costLimitPolicy, createPolicySet, registerModelTier, createMetrics

import { createCostEngine } from '@elsium-ai/gateway'
import { costLimitPolicy, createPolicySet } from '@elsium-ai/core'

const engine = createCostEngine()
const policies = createPolicySet([
  costLimitPolicy(500.00),  // $500/month cap
])

engine.on('projection', (p) => {
  if (p.projectedMonthly > 400) notify('Approaching budget limit')
})

Customer-Facing Products

6. Customer Support Chatbot

An AI agent that answers customer questions using your knowledge base, escalates to humans when unsure, and tracks every interaction for compliance.

Uses: defineAgent, createMemory, rag(), createApprovalGate, createConfidenceScorer, createAuditTrail, sseHeaders, streamResponse

import { defineAgent, createMemory, createApprovalGate } from '@elsium-ai/agents'
import { rag } from '@elsium-ai/rag'
import { createAuditTrail } from '@elsium-ai/observe'

const supportAgent = defineAgent({
  name: 'support',
  system: 'You are a helpful support agent. Answer from the knowledge base only.',
  memory: createMemory(),
  tools: [rag({ store: knowledgeBase })],
  approvalGate: createApprovalGate({ threshold: 'high-risk' }),
  audit: createAuditTrail({ hashChain: true }),
})

7. AI-Powered Search Engine

A search product that understands natural language queries, retrieves relevant documents from your corpus, and generates summarized answers with source citations.

Uses: rag(), createOpenAIEmbeddings, createPgVectorStore, mmrRerank, recursiveChunker, htmlLoader, markdownLoader

import { rag, createOpenAIEmbeddings, createPgVectorStore } from '@elsium-ai/rag'
import { mmrRerank, recursiveChunker, htmlLoader } from '@elsium-ai/rag'

const search = rag({
  embeddings: createOpenAIEmbeddings({ model: 'text-embedding-3-small' }),
  store: createPgVectorStore({ connectionString: env('DATABASE_URL') }),
  chunker: recursiveChunker({ chunkSize: 512 }),
  reranker: mmrRerank({ lambda: 0.7 }),
})

8. Document Q&A SaaS

Upload PDFs, docs, or websites and ask questions about them. The system chunks, embeds, and stores the content, then retrieves relevant passages to answer queries.

Uses: rag(), textLoader, htmlLoader, csvLoader, jsonLoader, fixedSizeChunker, sentenceChunker, createInMemoryStore, createPgVectorStore

import { rag, textLoader, htmlLoader, csvLoader } from '@elsium-ai/rag'
import { sentenceChunker, createPgVectorStore } from '@elsium-ai/rag'

const docQA = rag({
  loaders: [textLoader(), htmlLoader(), csvLoader()],
  chunker: sentenceChunker({ maxSentences: 5 }),
  store: createPgVectorStore({ connectionString: env('DATABASE_URL') }),
})

// Ingest a document
await docQA.ingest('/uploads/contract.pdf')
// Query it
const answer = await docQA.query('What are the payment terms?')

9. AI Writing Assistant

A writing tool that generates, edits, and refines content. Supports structured output for things like blog post outlines, social media calendars, or email drafts — all type-safe with schemas.

Uses: gateway().generate(), zodToJsonSchema, createStream, outputGuardrailMiddleware, costTrackingMiddleware, cacheMiddleware

import { gateway } from '@elsium-ai/gateway'
import { zodToJsonSchema } from '@elsium-ai/core'
import { z } from 'zod'

const BlogOutline = z.object({
  title: z.string(),
  sections: z.array(z.object({ heading: z.string(), points: z.array(z.string()) })),
})

const result = await llm.generate({
  prompt: 'Write a blog outline about TypeScript AI frameworks',
  schema: zodToJsonSchema(BlogOutline),
})
// result.data is fully typed as BlogOutline

10. AI-Powered Form Builder

Users describe what data they need to collect in natural language. The AI generates form schemas, validation rules, and even pre-fills fields. Returns structured JSON every time.

Uses: gateway().generate(), zodToJsonSchema, defineTool, defineWorkflow

import { gateway } from '@elsium-ai/gateway'
import { zodToJsonSchema } from '@elsium-ai/core'
import { defineWorkflow, step } from '@elsium-ai/workflows'

const formBuilder = defineWorkflow('build-form', [
  step('parse', async (input) => {
    return llm.generate({
      prompt: `Generate a form schema for: ${input.description}`,
      schema: zodToJsonSchema(FormSchema),
    })
  }),
  step('validate', async (schema) => validateFormSchema(schema)),
])

Enterprise & Internal Tools

11. Internal Knowledge Base Assistant

An AI that answers employee questions using internal docs, wikis, Slack history, and code repos. Enforces access control so people only see what they’re authorized to.

Uses: rag(), defineAgent, createRBAC, createMemory, createPgVectorStore, authMiddleware, createAuditTrail

import { defineAgent, createMemory } from '@elsium-ai/agents'
import { rag, createPgVectorStore } from '@elsium-ai/rag'
import { createRBAC } from '@elsium-ai/app'

const kbAgent = defineAgent({
  name: 'knowledge-base',
  system: 'Answer using internal documentation only. Cite your sources.',
  memory: createMemory(),
  tools: [rag({ store: createPgVectorStore({ connectionString: env('DB_URL') }) })],
  rbac: createRBAC({ roles: [{ name: 'employee', permissions: ['docs:read'] }] }),
})

12. Code Review Agent

An agent that reviews pull requests, checks for security issues, suggests improvements, and enforces coding standards. Uses tools to fetch code, run linters, and post comments.

Uses: defineAgent, defineTool, httpFetchTool, createAgentSecurity, detectPromptInjection, redactSecrets, runSequential

import { defineAgent } from '@elsium-ai/agents'
import { defineTool, httpFetchTool } from '@elsium-ai/tools'
import { createAgentSecurity, redactSecrets } from '@elsium-ai/agents'

const reviewer = defineAgent({
  name: 'code-reviewer',
  system: 'Review code for security issues, bugs, and style violations.',
  tools: [
    httpFetchTool(),
    defineTool('run-linter', { execute: async (code) => runEslint(code) }),
    defineTool('post-comment', { execute: async (comment) => postGitHubComment(comment) }),
  ],
  security: createAgentSecurity({ redactSecrets: true }),
})

13. Data Processing Pipeline

Batch-process thousands of records through an LLM — classify support tickets, extract entities from contracts, summarize meeting transcripts, or tag products.

Uses: createBatch, defineWorkflow, defineParallelWorkflow, step, costTrackingMiddleware, retry

import { createBatch } from '@elsium-ai/core'
import { defineWorkflow, step } from '@elsium-ai/workflows'

const pipeline = defineWorkflow('classify-tickets', [
  step('classify', async (ticket) => {
    return llm.generate({
      prompt: `Classify this ticket: ${ticket.text}`,
      schema: zodToJsonSchema(TicketCategory),
    })
  }),
])

const batch = createBatch(tickets, { concurrency: 10 })
const results = await batch.run(pipeline)

14. Compliance & Audit System

Every AI interaction logged with tamper-evident audit trails, provenance tracking, and content moderation. Required for regulated industries (healthcare, finance, legal).

Uses: createAuditTrail, createProvenanceTracker, auditMiddleware, outputGuardrailMiddleware, contentPolicy, policyMiddleware, createPolicySet

import { createAuditTrail, createProvenanceTracker } from '@elsium-ai/observe'
import { createPolicySet, contentPolicy } from '@elsium-ai/core'

const audit = createAuditTrail({ hashChain: true })
const provenance = createProvenanceTracker()
const policies = createPolicySet([
  contentPolicy({ blocked: ['PII', 'PHI'] }),
])

// Every call is logged, hashed, and policy-checked
audit.on('event', (e) => console.log(`${e.action} by ${e.actor} [hash: ${e.hash}]`))

15. AI-Powered ETL Tool

Extract data from unstructured sources (emails, PDFs, web pages), transform it with LLMs into structured formats, and load it into databases or APIs.

Uses: defineWorkflow, step, htmlLoader, jsonLoader, csvLoader, gateway().generate(), createBatch, executeStep

import { defineWorkflow, step } from '@elsium-ai/workflows'
import { htmlLoader, csvLoader } from '@elsium-ai/rag'

const etl = defineWorkflow('extract-transform-load', [
  step('extract', async (source) => htmlLoader().load(source.url)),
  step('transform', async (html) => {
    return llm.generate({
      prompt: `Extract structured data from: ${html}`,
      schema: zodToJsonSchema(ProductRecord),
    })
  }),
  step('load', async (record) => db.insert('products', record)),
])

Agent-Based Products

16. AI Sales Development Rep (SDR)

An agent that researches prospects, drafts personalized outreach emails, follows up automatically, and books meetings. Uses tools to access CRM, LinkedIn, and email APIs.

Uses: defineAgent, defineTool, httpFetchTool, createMemory, createSqliteMemoryStore, runSequential, createApprovalGate

import { defineAgent, createMemory, createApprovalGate } from '@elsium-ai/agents'
import { defineTool, httpFetchTool } from '@elsium-ai/tools'

const sdr = defineAgent({
  name: 'sales-rep',
  system: 'Research prospects and draft personalized outreach emails.',
  memory: createMemory({ store: createSqliteMemoryStore('./sdr.db') }),
  tools: [
    httpFetchTool(),
    defineTool('send-email', { execute: async (email) => sendEmail(email) }),
    defineTool('book-meeting', { execute: async (slot) => bookCalendar(slot) }),
  ],
  approvalGate: createApprovalGate({ actions: ['send-email'] }),
})

17. Research Agent

An autonomous agent that takes a research question, searches the web, reads documents, synthesizes findings, and produces a structured report with citations.

Uses: defineAgent, defineTool, httpFetchTool, rag(), runSupervisor, createMemory, defineWorkflow

import { defineAgent, createMemory } from '@elsium-ai/agents'
import { runSupervisor } from '@elsium-ai/agents'
import { defineTool, httpFetchTool } from '@elsium-ai/tools'

const researcher = defineAgent({
  name: 'researcher',
  system: 'Research topics thoroughly. Cite all sources.',
  memory: createMemory(),
  tools: [httpFetchTool(), defineTool('search', { execute: webSearch })],
})

const report = await runSupervisor({
  agents: [researcher],
  task: 'Research the state of TypeScript AI frameworks in 2025',
})

18. AI Project Manager

An agent that breaks down tasks, assigns them to specialist sub-agents (writer, coder, researcher), reviews their work, and assembles the final deliverable.

Uses: runSupervisor, runParallel, defineAgent, executeStateMachine, createApprovalGate, createConfidenceScorer

import { defineAgent, runSupervisor, runParallel } from '@elsium-ai/agents'
import { createApprovalGate } from '@elsium-ai/agents'

const writer = defineAgent({ name: 'writer', system: 'Write content.' })
const coder = defineAgent({ name: 'coder', system: 'Write code.' })
const reviewer = defineAgent({ name: 'reviewer', system: 'Review deliverables.' })

const result = await runSupervisor({
  agents: [writer, coder, reviewer],
  task: 'Build a landing page with copy and code',
  approvalGate: createApprovalGate({ threshold: 'final-review' }),
})

19. Conversational AI with Memory

A chatbot that remembers past conversations, user preferences, and context across sessions. Picks up where you left off, even days later.

Uses: defineAgent, createMemory, createSqliteMemoryStore, createContextManager, streamResponse, parseSSEStream

import { defineAgent, createMemory } from '@elsium-ai/agents'
import { createSqliteMemoryStore } from '@elsium-ai/agents'
import { streamResponse, parseSSEStream } from '@elsium-ai/app'

const assistant = defineAgent({
  name: 'assistant',
  system: 'You are a helpful assistant. Remember user preferences.',
  memory: createMemory({
    store: createSqliteMemoryStore('./memory.db'),
    contextWindow: 20,
  }),
})

// Streams response with full conversation history
const stream = await assistant.run('Continue where we left off', { userId: 'user-123' })

20. Multi-Agent Workflow System

A platform where users design agent pipelines visually — chain agents together, add branching logic, approvals, and parallel execution. Think “Zapier for AI agents.”

Uses: defineWorkflow, defineParallelWorkflow, defineBranchWorkflow, defineAgent, runSequential, runParallel, runSupervisor, executeStateMachine, onStepComplete

import { defineWorkflow, defineParallelWorkflow, defineBranchWorkflow } from '@elsium-ai/workflows'
import { defineAgent, runSequential, runParallel } from '@elsium-ai/agents'

const pipeline = defineWorkflow('content-pipeline', [
  step('research', async (topic) => researcher.run(topic)),
  step('write', async (research) => writer.run(research)),
  step('review', async (draft) => reviewer.run(draft)),
])

const parallel = defineParallelWorkflow('multi-format', {
  blog: (content) => writer.run(`Write a blog post: ${content}`),
  tweet: (content) => writer.run(`Write a tweet thread: ${content}`),
  email: (content) => writer.run(`Write a newsletter: ${content}`),
})

Developer Tools

21. LLM Testing & Eval Platform

A CI/CD tool that runs evaluations against your AI features on every deploy — regression detection, determinism checks, output pinning, and quality scoring.

Uses: runEvalSuite, createRegressionSuite, assertDeterministic, assertStable, createSnapshotStore, testSnapshot, pinOutput, formatEvalReport

import { runEvalSuite, createRegressionSuite, assertDeterministic } from '@elsium-ai/testing'
import { pinOutput, formatEvalReport } from '@elsium-ai/testing'

const suite = createRegressionSuite({
  name: 'classifier-v2',
  cases: testCases,
  assertions: [
    assertDeterministic({ runs: 5, tolerance: 0 }),
    pinOutput('expected-labels.json'),
  ],
})

const report = await runEvalSuite(suite)
console.log(formatEvalReport(report))
if (!report.passed) process.exit(1)  // Fail CI

22. AI Playground / Sandbox

A web app where developers test prompts against multiple providers side-by-side, compare costs, latency, and output quality in real time.

Uses: gateway, createAnthropicProvider, createOpenAIProvider, createGoogleProvider, xrayMiddleware, calculateCost, createStream, sseHeaders

import { gateway, createAnthropicProvider, createOpenAIProvider } from '@elsium-ai/gateway'
import { xrayMiddleware, calculateCost } from '@elsium-ai/gateway'

const providers = {
  anthropic: gateway({ provider: 'anthropic', middleware: [xrayMiddleware()] }),
  openai: gateway({ provider: 'openai', middleware: [xrayMiddleware()] }),
}

// Run same prompt on both, compare results
const results = await Promise.all(
  Object.entries(providers).map(async ([name, gw]) => ({
    name,
    result: await gw.complete(request),
    cost: calculateCost(name, request),
  }))
)

23. MCP Tool Server

A server that exposes your internal tools (databases, APIs, calculators) to any MCP-compatible AI client (Claude Desktop, etc.). Your tools become universally accessible.

Uses: createMCPServer, defineTool, createToolkit, calculatorTool, httpFetchTool, jsonParseTool

import { createMCPServer } from '@elsium-ai/mcp'
import { defineTool, calculatorTool, httpFetchTool } from '@elsium-ai/tools'

const server = createMCPServer({
  name: 'internal-tools',
  tools: [
    calculatorTool(),
    httpFetchTool(),
    defineTool('query-db', {
      description: 'Query the internal database',
      execute: async (sql) => db.query(sql),
    }),
  ],
})

24. AI SDK / Client Library

Ship a client library so your customers can integrate with your AI service. Typed endpoints, streaming support, and SSE parsing included.

Uses: createClient, parseSSEStream, createApp, createRoutes, sseHeaders, formatSSE, streamResponse

import { createClient, parseSSEStream } from '@elsium-ai/app'

// Server: expose typed routes
const app = createApp({ routes: createRoutes({ prefix: '/api/v1' }) })

// Client: consume with full types
const client = createClient({ baseUrl: 'https://api.example.com/v1' })
const stream = await client.complete({ prompt: 'Hello' })
for await (const chunk of parseSSEStream(stream)) {
  process.stdout.write(chunk.text)
}

Industry-Specific

25. Legal Document Analyzer

Upload contracts and legal documents. The system extracts clauses, identifies risks, compares against templates, and generates summaries — all with audit trails for compliance.

Uses: rag(), textLoader, gateway().generate(), createAuditTrail, createProvenanceTracker, createBatch, outputGuardrailMiddleware

import { rag, textLoader } from '@elsium-ai/rag'
import { createAuditTrail, createProvenanceTracker } from '@elsium-ai/observe'

const legalAnalyzer = rag({
  loaders: [textLoader()],
  store: contractStore,
})

const audit = createAuditTrail({ hashChain: true })
const analysis = await legalAnalyzer.query('What are the termination clauses?')
audit.log({ action: 'legal-analysis', document: 'contract-2024.pdf', result: analysis })

26. Healthcare Triage Assistant

A patient-facing chatbot that collects symptoms, suggests possible conditions, and routes to the right specialist. Content guardrails prevent medical advice, and every interaction is audited.

Uses: defineAgent, outputGuardrailMiddleware, contentPolicy, createAuditTrail, createApprovalGate, createMemory, createRBAC

import { defineAgent, createMemory, createApprovalGate } from '@elsium-ai/agents'
import { createAuditTrail } from '@elsium-ai/observe'
import { contentPolicy, createPolicySet } from '@elsium-ai/core'

const triageAgent = defineAgent({
  name: 'triage',
  system: 'Collect symptoms and suggest specialists. Never provide diagnoses.',
  memory: createMemory(),
  policies: createPolicySet([contentPolicy({ blocked: ['diagnosis', 'prescription'] })]),
  audit: createAuditTrail({ hashChain: true }),
  approvalGate: createApprovalGate({ actions: ['refer-specialist'] }),
})

27. Financial Report Generator

Takes raw financial data (CSV, JSON), analyzes trends, and generates narrative reports with charts context. Enforces cost limits to prevent runaway API spend.

Uses: csvLoader, jsonLoader, defineWorkflow, gateway().generate(), costLimitPolicy, createCostEngine, createBatch

import { defineWorkflow, step } from '@elsium-ai/workflows'
import { csvLoader } from '@elsium-ai/rag'
import { costLimitPolicy, createPolicySet } from '@elsium-ai/core'

const reportGenerator = defineWorkflow('financial-report', [
  step('load', async (file) => csvLoader().load(file)),
  step('analyze', async (data) => llm.generate({
    prompt: `Analyze financial trends: ${JSON.stringify(data)}`,
    policies: createPolicySet([costLimitPolicy(2.00)]),
  })),
  step('format', async (analysis) => formatReport(analysis)),
])

28. E-Commerce Product Catalog Enrichment

Batch-process product listings: generate descriptions, extract attributes, classify categories, translate to multiple languages, and detect duplicate entries.

Uses: createBatch, defineWorkflow, defineParallelWorkflow, gateway().generate(), costTrackingMiddleware, cacheMiddleware

import { createBatch } from '@elsium-ai/core'
import { defineParallelWorkflow } from '@elsium-ai/workflows'

const enrich = defineParallelWorkflow('enrich-product', {
  description: (product) => llm.generate({ prompt: `Write a description for: ${product.name}` }),
  categories: (product) => llm.generate({ prompt: `Classify: ${product.name}`, schema: CategorySchema }),
  translations: (product) => llm.generate({ prompt: `Translate to ES, FR, DE: ${product.name}` }),
})

const batch = createBatch(products, { concurrency: 20 })
await batch.run(enrich)

29. Education / Tutoring Platform

An AI tutor that adapts to each student, remembers their progress across sessions, explains concepts at the right level, and generates practice problems.

Uses: defineAgent, createMemory, createSqliteMemoryStore, createExperiment, createContextManager, streamResponse

import { defineAgent, createMemory } from '@elsium-ai/agents'
import { createSqliteMemoryStore } from '@elsium-ai/agents'

const tutor = defineAgent({
  name: 'tutor',
  system: `You are a patient tutor. Adapt explanations to the student's level.
Remember what they've learned and what they struggle with.`,
  memory: createMemory({
    store: createSqliteMemoryStore('./students.db'),
    contextWindow: 50,
  }),
})

await tutor.run('Explain recursion', { userId: 'student-42' })

Security & Governance Products

30. AI Firewall / Content Moderation

A proxy that sits in front of any LLM and blocks prompt injections, jailbreaks, PII leaks, and policy violations before they reach the model or the user.

Uses: securityMiddleware, detectPromptInjection, detectJailbreak, redactSecrets, checkBlockedPatterns, outputGuardrailMiddleware, contentPolicy, policyMiddleware

import { createAgentSecurity, detectPromptInjection, detectJailbreak } from '@elsium-ai/agents'
import { redactSecrets, checkBlockedPatterns } from '@elsium-ai/agents'
import { contentPolicy, createPolicySet } from '@elsium-ai/core'

const firewall = createAgentSecurity({
  checks: [detectPromptInjection(), detectJailbreak(), checkBlockedPatterns()],
  redaction: redactSecrets(),
  policies: createPolicySet([contentPolicy({ blocked: ['PII', 'credentials'] })]),
})

// Apply to any gateway
const secureLLM = gateway({
  provider: 'anthropic',
  middleware: [firewall.middleware()],
})

31. AI Access Control System

Centralized control over who can use which models, with what token limits, at what cost cap. Role-based access with approval workflows for expensive operations.

Uses: createRBAC, modelAccessPolicy, tokenLimitPolicy, costLimitPolicy, createPolicySet, createApprovalGate, createAuditTrail

import { createRBAC } from '@elsium-ai/app'
import { modelAccessPolicy, tokenLimitPolicy, costLimitPolicy, createPolicySet } from '@elsium-ai/core'
import { createApprovalGate } from '@elsium-ai/agents'
import { createAuditTrail } from '@elsium-ai/observe'

const accessControl = {
  rbac: createRBAC({
    roles: [
      { name: 'intern', permissions: ['model:use:gpt-4o-mini'], inherits: [] },
      { name: 'engineer', permissions: ['model:use:*'], inherits: ['intern'] },
      { name: 'admin', permissions: ['*'], inherits: ['engineer'] },
    ],
  }),
  policies: createPolicySet([
    modelAccessPolicy(['claude-sonnet-4-6', 'gpt-4o', 'gpt-4o-mini']),
    tokenLimitPolicy(100_000),
    costLimitPolicy(50.00),
  ]),
  approvalGate: createApprovalGate({ costThreshold: 10.00 }),
  audit: createAuditTrail({ hashChain: true }),
}

Summary by Complexity

Complexity Products Time to MVP
Weekend project AI Playground, MCP Tool Server, AI Writing Assistant, Document Q&A 1–3 days
Side project Customer Support Chatbot, AI Search Engine, LLM Testing Platform, Data Processing Pipeline 1–2 weeks
Startup MVP Multi-Tenant AI Platform, AI Gateway, Prompt Management Platform, Multi-Agent Workflow System 2–4 weeks
Enterprise product AI Firewall, Compliance System, AI Observability Dashboard, Healthcare Triage Assistant 1–3 months

All 30 products can be built entirely with @elsium-ai/* packages — no additional AI framework dependencies needed.


Get Started

npm install elsium-ai

Pick a product from the list above and start building. Every code snippet is a working starting point.