AI won't break your rules.
It'll walk right between them.

Cross-step correlation. Real-time action enforcement. Runs inside your app.

Start with code
1. Run: npx skills add arcjet/skills
2. Add Arcjet protection to my app
Model: Totoro 1.302

Securing AI workflows at:

What your other controls miss

Unauthorized tool calls

Unauthorized tool calls

The request looks clean. Then the workflow issues a refund, reads a file, or hits an internal API. Arcjet enforces at the action boundary, before it fires, not after.

Data exfiltration

Data exfiltration

Sensitive data slips out through prompts, tool outputs, and model context. Arcjet catches it inside the workflow, before it ever leaves the application.

Cost explosion

Cost explosion

Runaway agent loops can burn a token budget in minutes. Without inline enforcement, the first you hear of it is the bill.

What Arcjet catches in real time

AI endpoint abuse protection

Cap tokens per user and org. Stop automated abuse before it reaches the model.

/ai-endpoint.ts
const aj = arcjet({
// User/org scope
characteristics: [
"userId",
"orgId"
],
rules: [
// Block scrapers and bots
detectBot({ ... }),
// Token budgets
tokenBucket({ ... }),
],
});
// Block before inference
const decision = await aj
.protect(req, {
userId: user.id,
orgId: user.orgId,
requested: estimatedTokens,
});

Prompt injection detection

Catch hostile prompts in user input and tool outputs before they reach the model.

/ai-endpoint.ts
const aj = arcjet({
rules: [
detectPromptInjection({
mode: "LIVE"
})
],
});
// Detect prompt
const decision = await aj
.protect(req, {
detectPromptInjectionMessage:
userMessage,
});
if (
decision.isDenied()
&& decision.reason
.isPromptInjection()
) {
return new Response(
"Forbidden",
{ status: 403 }
);
}

AI data loss prevention

Strip sensitive data before it reaches model context, logs, or third-party tools.

/ai-endpoint.ts
const aj = arcjet({
rules: [
sensitiveInfo({
mode: "LIVE",
deny: [
"EMAIL",
"CREDIT_CARD_NUMBER",
],
}),
],
});
// Catch before LLM
const decision = await aj
.protect(req, {
sensitiveInfoValue:
userMessage,
});
if (
decision.isDenied()
&& decision.reason
.isSensitiveInfo()
) {
return new Response(
"Sensitive data blocked",
{ status: 403 }
);
}

Agent tool controls

Scope what every agent is allowed to do, by identity, role, and route, and enforce it in real time.

/ai-endpoint.ts
const aj = arcjet({
characteristics: ["agentId"],
});
// Per-request
const ajForAdmin = aj.withRule(tokenBucket({
rate: 1000, interval: "1m", capacity: 1000,
}));
const ajForMember = aj.withRule(tokenBucket({
rate: 100, interval: "1m", capacity: 100,
}));
let decision;
if (role === "admin") {
decision = ajForAdmin
.protect(req, { agentId: agent.id });
} else {
decision = ajForMember
.protect(req, { agentId: agent.id });
}
if (decision.isDenied()) {
return new Response("Unauthorized", { status: 403 });
}

Bring us your scariest AI workflow.Arcjet stops actions your stack would only log.

Start with code
1. Run: npx skills add arcjet/skills
2. Add Arcjet protection to my app