Skip to content
Back to skills

Brain

ASecurity

Consolidate short-term events into long-term 'Semantic' memory.

  • 23 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added October 14, 2026
ai-agentsgosqlrailsdebuggingapidatabasesecurity

Works with

  • api

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned October 14, 2026

npx -y skills add andreibesleaga/GABBE --skill brain --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Brain?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Brain
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/andreibesleaga-brain-a32fae22/badge)](https://www.skillsdirectory.com/skills/andreibesleaga-brain-a32fae22)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: episodic-consolidation
description: Consolidate short-term events into long-term 'Semantic' memory.
triggers: [episodic consolidation]
tags: [brain]
context_cost: high
tools: [write_to_file, grep_search]
---
# Episodic Consolidation Skill

## Goal
This skill mimics the brain's "Sleep" process (Hippocampus to Neocortex transfer). Use it at the end of a long task (Task Boundary).

## Steps
## 1. The Consolidation Process
1.  **Replay:** Review the `AUDIT_LOG.md` or Session History.
2.  **Extract:** Identify "Generalized Rules" from specific events.
    *   *Event:* "I fixed a bug in `auth.go` caused by nil pointer."
    *   *Rule:* "Always check for nil in `auth.go` User structs."
3.  **Store:** Write this Rule to `memory/semantic/rules.md`.

## 2. Identifying Episodic Drifts
Check if the "Story" of the project has changed.
*   **Drift:** "We used to use SQL, now we use NoSQL."
*   **Action:** Update the `PROJECT_CONTEXT.md` (The World Model) to reflect this new reality.

## 3. Pruning (Forgetting)
Active forgetting is crucial.
*   **Action:** Delete temporary scratchpads, logs, or `tmp/` files that are no longer predicting the future.

## Security & Guardrails

### 1. Skill Security (Episodic Consolidation)
- **Malicious Rule Extraction**: During the "Extract" phase, an attacker might have deliberately failed a test with a highly specific error message designed to trick the agent into formulating a dangerous "Generalized Rule" (e.g., "Always disable TLS when contacting `internal-api.com`"). The agent must rigorously validate any extracted rule against the immutable `architecture-governance.skill.md` constraints before committing it to Semantic Memory.
- **Overzealous Pruning (Audit Destruction)**: In the "Pruning" phase, the agent deletes temporary logs. The agent must differentiate between "scratchpads" (safe to delete) and "Security/Audit Logs" (never delete). If the agent mistakenly prunes cryptographic signatures or deployment receipts because they "are no longer predicting the future," it destroys the project's non-repudiation guarantees.

### 2. System Integration Security
- **Cross-Session Data Leakage**: When consolidating episodic memories from a session that handled highly sensitive data (e.g., PII, database passwords), the agent must ensure that the "Generalized Rule" (Step 1.2) is perfectly abstracted. If a rule is saved as "Always check for nil when parsing `user=john_doe, pwd=secret123`," the agent has permanently leaked a credential into its long-term semantic knowledge base.
- **Drift Justification of Vulnerabilities**: The "Identifying Episodic Drifts" phase (Step 2) updates the World Model. The agent must never interpret a temporary security waiver or a "quick hack" (e.g., opening a firewall port for debugging) as a permanent "Drift" in the system architecture. Security downgrades are incidents, not structural drifts.

### 3. LLM & Agent Guardrails
- **Consolidation Hallucination**: The LLM might hallucinate patterns bridging unrelated events to create a generalized rule that does not exist empirically (Pareidolia). The agent must require a strict minimum threshold of occurrences (e.g., "Observation seen >= 3 times") before granting an event the status of a "Generalized Rule" in Semantic memory.
- **Self-Confirming Bias Loop**: If an insecure coding practice is accidentally consolidated into Semantic Memory, future Active Inference cycles will use it as a "True" prior, actively enforcing the vulnerability across the codebase. The agent must routinely subject its own Semantic Memory (`rules.md`) to external, asynchronous adversarial review (e.g., via `security-audit.skill`) to break self-confirming bias loops.

Files in this skill

  • README.md3.8 KB
  • active-inference.skill.md4.4 KB
  • brain-mode.skill.md8.5 KB
  • cognitive-architectures.skill.md3.3 KB
  • cognitive-testing.skill.md5.2 KB
  • consciousness-loop.skill.md3.8 KB
  • cost-benefit-router.skill.md6.2 KB
  • episodic-consolidation.skill.md3.6 KB
  • epistemology-knowledge.skill.md4 KB
  • global-workspace.skill.md3.8 KB
  • learning-adaptation.skill.md5.2 KB
  • loki-mode.skill.md15.9 KB
  • neuroscience-foundations.skill.md3.8 KB
  • scripts/active_inference_loop.py2.6 KB
  • scripts/cognition_test.py2.2 KB
  • scripts/global_workspace.py2.8 KB
  • self-improvement.skill.md5.7 KB
  • sensory-motor.skill.md4 KB
  • sequential-thinking.skill.md3.9 KB
  • working-memory.skill.md4.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.