Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add arcjet/arcjet-js --skill integrate-arcjet-guard-mastragit clone --depth 1 https://github.com/arcjet/arcjet-jsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/arcjet/arcjet-js/integrate-arcjet-guard-mastra)<a href="https://agentmods.dev/skills/arcjet/arcjet-js/integrate-arcjet-guard-mastra"><img src="https://agentmods.dev/badge/skills/arcjet/arcjet-js/integrate-arcjet-guard-mastra/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/arcjet/arcjet-js/integrate-arcjet-guard-mastra"><img src="https://agentmods.dev/badge/skills/arcjet/arcjet-js/integrate-arcjet-guard-mastra.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00082 | $0.02567 |
| Opus 5 | $0.00041 | $0.01283 |
| Sonnet 5 | $0.00016 | $0.00513 |
| Haiku 4.5 | $0.00008 | $0.00257 |
Grade A, and why
integrate-arcjet-guard-mastra scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 255 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Integrate Arcjet Guard into a Mastra agent
@arcjet/guard's Mastra v1 namespace wraps the agent's existing Arcjet
client. It never talks to the Arcjet API itself. Four surfaces, one
decision rule:
- An authored tool (
createTool({ execute })) →guardTool(). DENY is a structured tool result. Do not throw. - Inbound / outbound text (
inputProcessors/outputProcessors) →guardProcessor().processInput+abort()on DENY raises a tripwire.processInputStepscreens later agentic steps (tool continuations). Channels already hitprocessInput, so there is noguardInbound. - MCP / workspace / toolsets you did not wrap →
guardHooks().beforeToolCallcan return{ proceed: false, output }. - Correlation →
mastraAgentContext()readsMASTRA_THREAD_ID_KEY, then resource, then run. It never mints a new id.
Mastra requireApproval is human HITL, not policy — same trap as
Google ADK requireConfirmation. There is no
guardApproval. Do not also wrap these tools with
@arcjet/guard/vercel-ai/v7 or @arcjet/guard/claude-managed-agents/v0.
Questions to ask the human first
Ask only what you cannot infer from the code; suggest defaults.
- Which tools are risky (external side effects, irreversible, spends
money, sends messages)? Those get
guardTool. Purely informational tools can be left unguarded or gated with norules. - What limits? (e.g. "10 lookups/min per order" →
tokenBucket.) - Who is the user for metadata — an opaque user/tenant ID (never PII)?
Default: Mastra's resource id (
MASTRA_RESOURCE_ID_KEY). - Is an Arcjet outage unacceptable? Every helper defaults to
onGuardError: "deny". Ask explicitly about the inbound processor: failing closed there means the agent stops answering for the duration of the outage, so"allow"is a routine and legitimate choice at that one call site.
The six things readers get wrong
- There is no
guardInbound. Mastra channels already run throughprocessInput. Screen prompt injection onguardProcessorininputProcessors. - There is no
guardApproval. MastrarequireApprovalis a human in-the-loop pause, not a policy gate. UseguardToolorguardHooks. - The import path is versioned and there is no alias.
@arcjet/guard/mastra/v1.@arcjet/guard/mastradoes not resolve. - Correlation is read, never minted. Do not call
createAgentContextinside a Mastra callback — that generates a second id and splits the Sequence.mastraAgentContextreads thread / resource / run and omitscorrelationIdwhen none of those is a valid id. - Do not double-wrap with
@arcjet/guard/vercel-ai/v7. Mastra tools arecreateTool, not AI SDKtool().guardToolthrows if the tool already carries the Arcjet protection brand. - A denial from
guardToolis a structured result, not a throw. Prefer omittingoutputSchemaon guarded tools, or verify the schema acceptsArcjetDenialResult. IfonDenythrows, the tool still does not run and the model still receives the default denial object.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago Changed · +7 lines 8cf9e5599083
- 6d ago Changed · +6 lines 3c5d30707309
- 12d ago First seen · 242 lines · 82 tokens per session scan A d98d6420ca07
integrate-arcjet-guard-mastra is a skill published in the GitHub repository arcjet/arcjet-js (682 stars, last pushed today), licensed Apache-2.0. It adds 82 tokens to every session and 2,567 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
clinical-trial-protocol-skill
Generate clinical trial protocols for medical devices or drugs. This skill should be used when users say "Create a clinical trial protocol", "Generate protocol for [device/drug]", "Help me design a clinical study", "Research similar trials for [intervention]", or when developing FDA submission documentation for…
claude-d3js-skill
This skill provides guidance for creating sophisticated, interactive data visualisations using d3.js.
adr-skill
Create and maintain Architecture Decision Records (ADRs) optimized for agentic coding workflows. Use when you need to propose, write, update, accept/reject, deprecate, or supersede an ADR; bootstrap an adr folder and index; consult existing ADRs before implementing changes; or enforce ADR conventions. This skill uses…
linear-claude-skill
Manage Linear issues, projects, and teams.
playwright-skill
IMPORTANT - Path Resolution: This skill can be installed in different locations (plugin system, manual installation, global, or project-specific). Before executing any commands, determine the skill directory based on where you loaded this SKILL.md file, and use that path in all commands below.
terraform-skill
Terraform infrastructure as code best practices.