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 catpilotai/catpilot-ai-guardrails --skill memory-and-identitygit clone --depth 1 https://github.com/catpilotai/catpilot-ai-guardrailsWrote 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/catpilotai/catpilot-ai-guardrails/memory-and-identity)<a href="https://agentmods.dev/skills/catpilotai/catpilot-ai-guardrails/memory-and-identity"><img src="https://agentmods.dev/badge/skills/catpilotai/catpilot-ai-guardrails/memory-and-identity/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/catpilotai/catpilot-ai-guardrails/memory-and-identity"><img src="https://agentmods.dev/badge/skills/catpilotai/catpilot-ai-guardrails/memory-and-identity.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00052 | $0.01271 |
| Opus 5.5 | $0.00021 | $0.00508 |
| Sonnet 5.5 | $0.00010 | $0.00254 |
| Haiku 4.5 | $0.00005 | $0.00127 |
Grade A, and why
memory-and-identity 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 10d 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 — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Baseline
Applies when: Persisting or retrieving agent memory, RAG context, or audit logs, injecting retrieved documents or tool output into model prompts, or managing agent behavioral/identity files (SOUL.md, AGENTS.md, IDENTITY.md, CLAUDE.md).
Always:
- Scope persistent agent memory by
(user_id, session_id)and redact secrets and PII before writing to memory, logs, or agent outputs. - Separate untrusted RAG/tool output from system instructions using explicit structural delimiters and a system rule stating that instructions inside retrieved context must be ignored.
- Hash behavioral and identity files (
SOUL.md,AGENTS.md,IDENTITY.md,CLAUDE.md) with SHA-256 at session start, alert the human when a hash changes unexpectedly, and keep behavioral files separate from mutablememory/*.mdnotes. - Log every tool invocation to an append-only audit trail with timestamp, agent ID, tool name, sanitized args, truncated sanitized result, and duration.
- Inject runtime credentials via environment variables or short-lived vault tokens scoped to minimum permissions (read-only where possible), never as tool arguments.
Never:
- Share a single global memory store across different users or trust boundaries, or store unredacted API keys, passwords, or connection strings in memory or logs.
- Concatenate retrieved RAG documents or tool outputs directly into the system prompt as trusted instructions.
- Allow an agent to silently rewrite its own behavioral or identity files without human diff review and approval.
Open the full component before acting: it has the examples, the remediation steps, and the detection patterns.
Why
Persistent memory and behavioral instruction files (SOUL.md, AGENTS.md) outlive a single turn. If a prompt injection in a retrieved web page or ticket is saved into memory or edits an identity file, a one-turn exploit becomes a permanent backdoor across future sessions. Similarly, storing raw tool outputs in memory or logs without secret redaction turns the memory store into a credential dump.
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.
- 10d ago First seen · 123 lines · 52 tokens per session scan A f741c72bb66c
memory-and-identity is a skill published in the GitHub repository catpilotai/catpilot-ai-guardrails (2 stars, last pushed 8d ago), licensed MIT. It adds 52 tokens to every session and 1,271 once invoked, about $0.0002 per session on Opus 5.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-10-29.
memory-and-identity compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| memory-and-identitycatpilotai/catpilot-ai-guardrails | Skill | 2 | 8d ago | MIT | A | 52 | Claude Code |
| memory-triagemem0ai/mem0 | Skill | 69k | yesterday | Apache-2.0 | A | 58 | Claude Code |
| mem0-vercel-ai-sdkmem0ai/mem0 | Skill | 69k | yesterday | Apache-2.0 | A | 146 | Claude Code, Codex |
| mem0-climem0ai/mem0 | Skill | 69k | yesterday | Apache-2.0 | A | 177 | Claude Code, Codex |
| mem0-scopemem0ai/mem0 | Skill | 69k | yesterday | Apache-2.0 | A | 52 | Claude Code, Codex |
| mem0-forgetmem0ai/mem0 | Skill | 69k | yesterday | Apache-2.0 | A | 43 | Claude Code, Codex |
| mem0-remembermem0ai/mem0 | Skill | 69k | yesterday | Apache-2.0 | A | 52 | Claude Code, Codex |