Forensic recorder for agentic software
AgentRail
The flight recorder for AI agents. Trace decisions, tool calls, evidence, and spend before an agent becomes impossible to explain.

How evidence moves
AgentRail keeps cost and action proof out of the SDK hot path, then rebuilds the run for investigation.
Instrument
Add the TypeScript SDK around a trace and let spans inherit actor context unless a tool overrides it.
Accept
The ingestion endpoint returns 202 only after a fast enqueue, while worker jobs handle durable processing.
Price
Workers compute cost_usd from the shared catalog. Unknown model pricing stays null and explicit.
Investigate
The dashboard reconstructs Trace Rail, Action Ledger, and payload evidence through backend routes.
Built for AWS-native deployment
The local M1 stack maps directly to AWS services without changing AgentRail's core contract.
- Ingest
- API Gateway and Lambda accept spans with HMAC API keys.
- Buffer
- SQS keeps ingestion fast while workers process traces.
- Store
- RDS/PostgreSQL stores metadata and S3 stores redacted evidence.
- Observe
- CloudWatch tracks queue health, worker failures, and latency.
- Extend
- Amazon Bedrock cost and audit integrations fit the same model catalog path.
Planned AWS path: API Gateway, Lambda, SQS, RDS/PostgreSQL, S3, CloudWatch, and Amazon Bedrock cost metadata.
NPM publish-ready
Install AgentRail with npm
Copy the public package names from here. The registry commands are prepared and smoke-tested, but they still require npm authentication and ownership of the selected @agentrail-sdk scope before they are advertised as live downloads.
- Available today
- Source checkout + local Docker setup
- Package state
- pnpm pack smoke tests pass for SDK, contracts, DB, and MCP
- NPM target
- @agentrail-sdk/sdk for apps, @agentrail-sdk/mcp for Codex-style tools
- Publish blocker
- npm auth and @agentrail-sdk scope ownership
Do not treat the commands as live downloads until npm view @agentrail-sdk/sdk and npm view @agentrail-sdk/mcp resolve to this repository.
Target command after registry publish
Use these exact package namesnpm install @agentrail-sdk/sdkAdd AgentRail tracing to a TypeScript AI application.
npx @agentrail-sdk/mcpOpen read-only trace lookup from Codex-style tools.
import { AgentRail, BufferedDelivery, HttpSpanTransport } from "@agentrail-sdk/sdk";
const delivery = new BufferedDelivery({
transport: new HttpSpanTransport({
endpoint: "http://localhost:3001/v1/spans",
apiKey: process.env.AGENTRAIL_API_KEY!,
}),
});
const rail = new AgentRail({
actor: { agentId: "research-agent", onBehalfOf: "user_42" },
sink: delivery,
});
await rail.trace({ name: "research.answer" }, async (trace) => {
await trace.span(
{
kind: "llm",
name: "draft",
model: "test.known",
inputTokens: 1_000,
outputTokens: 500,
},
async () => undefined,
);
await trace.action({ name: "filesystem.read" }, async () => undefined);
});
await rail.shutdown({ timeoutMs: 5_000 });Founding tester program
AgentRail needs three developer teams to test real agent workflows: one SDK integration, one local dashboard review, and one MCP reader workflow.
- AI agent application developer
- internal automation team
- open-source maintainer using Codex or Claude-style tools
Open-source first, self-hosted by default
Run AgentRail locally, inspect recorded agent behavior, and keep sensitive evidence under your control.