Back to skill

Security audit

Biomimetic Memory Architecture

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with memory management, but it installs persistent automation that can rewrite and move private memory files with under-scoped approval and path-safety problems.

Install only after reviewing the cron jobs and retention workflow. Treat daily and weekly automation as persistent access to private memory, disable or remove default crons if you do not want autonomous writes, and do not run Phase 2 with --execute unless you have reviewed the audit report and trust every path in it.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (4)

T01 · Skill Instruction Hijacking

Error
Location
scripts/install.sh:468
Finding

Persistent Agent Instruction Hijacking and Memory Poisoning

Content
View full analysis
"$WORKSPACE/AGENTS.md" << AGENTSEOF # AGENTS.md — Operating Protocol $AGENTS_BOOT ## Principles Live in MEMORY.md under 🔴 PRINCIPLES. Follow them always. ``` The installer also writes mandatory persistent rules into `MEMORY.md`: ```text ## 🔴 PRINCIPLES (always loaded, always followed) ### P2: Write It Down Do not mentally note — commit to memory files. Update indexes after significant work. Write before responding: when a user states a preference, makes a decision, gives a deadline, or corrects you, write it to the relevant memory file before composing your response. ``` Lessons inferred from daily logs are promoted into a boot instruction file: ```python def cmd_promote(args: argparse.Namespace) -> int: cfg = load_config(Path(args.config)) data = load_store(Path(args.store)) selected = select_lessons(data, cfg, limit=args.limit, threshold=args.threshold, store=Path(args.store)) path = Path(args.output) if args.output else Path(args.store).parent / "BOOTSTRAP.md" path.parent.mkdir(parents=True, exist_ok=True) lines = ["# Lesson-Imprint", "", "Autogenerated safeguards from repeated past failures. Apply only when relevant and never above system/user instructions.", ""] lines += [f"- [{x['key_type']}:{x['key']}] {x['correct_action']}" for x in selected] path.write_text("\n".join(lines).rstrip() + "\n", encoding="utf-8") print(f"promoted {len(selected)} lessons to {path}") return 0 ``` ### Technical Analysis The installer creates durable agent instruction files and labels their contents as rules that must always be followed. These instructions affect unrelated future sessions rather than remaining s ...[truncated 2042 chars]
Remediation
View remediation

T06 · System Persistence

Error
Location
scripts/install.sh:862
Finding

Unconditionally Installed Autonomous Scheduled Tasks

Content
View full analysis
/dev/null; then # Daily Memory Distillation EXISTING=$(openclaw cron list --json 2>/dev/null | grep -c "Memory Distillation" || true) if [ "$EXISTING" = "0" ]; then CRON_MSG="Daily memory maintenance. Read skills/biomimetic-memory-architecture/references/daily-distillation.md for full instructions and follow them. Workspace: $WORKSPACE" if [ "$DRY_RUN" = "true" ]; then echo " [DRY RUN] Would run: openclaw cron add --name 'Daily Memory Distillation' --cron '0 3 * * *'" else openclaw cron add \ --name "Daily Memory Distillation" \ --cron "0 3 * * *" \ --tz "$TZ" \ --session "isolated" \ --timeout-seconds 600 \ --model "$USER_MODEL" \ --no-deliver \ --message "$CRON_MSG" 2>/dev/null fi fi # Weekly Synthesis EXISTING=$(openclaw cron list --json 2>/dev/null | grep -c "Weekly Synthesis" || true) if [ "$EXISTING" = "0" ]; then if [ "$DRY_RUN" = "true" ]; then echo " [DRY RUN] Would run: openclaw cron add --name 'Weekly Synthesis' --cron '0 5 * * 0'" else openclaw cron add \ --name "Weekly Synthesis" \ --cron "0 5 * * 0" \ --tz "$TZ" \ --session "isolated" \ --timeout-seconds 600 \ --model "$USER_MODEL" \ --no-deliver \ --message "Weekly synthesis. Read skills/biomimetic-memory-architecture/references/weekly-synthesis.md for full instructions and follow them. Workspace: $WORKSPACE" 2>/dev/null fi fi fi ``` The updater can subsequently replace the persistent job messages: ```bash if openclaw cron update "$id" --message "$messa ...[truncated 2047 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/weekly-synthesis.md:86
Finding

Weekly Workflow Automatically Moves Memory Without the Declared Approval Gate

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/bma_phase2_migrate.py:348
Finding

Path Traversal and Arbitrary File Movement Through Crafted Audit Reports

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (75)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 51)May include surrounding context.

md
| Lesson-Imprint CLI | `scripts/lesson_imprint.py` |

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · references/daily-distillation.md (reported line 141)May include surrounding context.

md
l Audit (P8 Enforcement)

- Scan today's daily logs for instances where the agent deferred to the user. Cross-reference with TOOLS.md, INFRA.md, and memory/. Flag unnecessary deferrals.

## Failure Root Cause (P7 Enforcement)

- Scan today's daily logs for ❌ FAILURE: or 🔧 CORRECTION: entries. Verify root cause analysis exists. If missing, add it.

## Cron Health

- Run openclaw cron list and crontab -l. Verify no two jobs within 15 minutes. Fix MEMORY.md jobs table if out of sync.

---

Before completing, append debrief to memory/YYYY-MM-DD.md.
Reply with brief summary.


## Public Release Notes

This file is intended to be workspace-generic. Replace `<workspace>` or set `CLAWD_WORKSPACE` when using it outside the original development environment. Do not include private paths, user IDs, tokens, or real memory examples in published templates.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill presents the BMA retention review as "read-only by default" but then instructs the agent to automatically execute a second phase that moves files and deletes the audit report. That inconsistency can mislead operators and downstream agents into treating the workflow as non-destructive when it performs state-changing archival actions, increasing the chance of unintended data relocation and loss of audit artifacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The instructions direct automatic execution of file-moving operations and cleanup of the audit report without confirmation, even though those actions alter the memory store and remove process evidence. In an agent skill context, this is dangerous because the agent may perform irreversible organizational changes, hide what happened by deleting the report, and do so based solely on prompt instructions rather than an authenticated approval step.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

The installer is explicitly designed to modify the workspace and persistent agent behavior, including writing memory files, scheduler entries, and configuration markers. In an agent-skill context, self-modifying/persistence-establishing behavior is security-relevant because it changes future execution conditions and can silently widen the system's long-term data-handling footprint.

Content

Scanner excerpt · scripts/install.sh (reported line 3)May include surrounding context.

sh
#!/bin/bash
# BMA — Biomimetic Memory Architecture Installer
# Safe to re-run: won't overwrite existing files.
set -euo pipefail

BMA_VERSION="0.1.7"

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/update.sh (reported line 29)May include surrounding context.

sh
fi
  touch "$FLAGS_FILE"
  if grep -q "^${key}=" "$FLAGS_FILE" 2>/dev/null; then
    sed -i.bak "s/^${key}=.*/${key}=${value}/" "$FLAGS_FILE" && rm -f "$FLAGS_FILE.bak"
  else
    echo "${key}=${value}" >> "$FLAGS_FILE"
  fi

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 21)May include surrounding context.

sh
VAULT_DIR="$WORKSPACE/.vault"
VAULT_FILE="$VAULT_DIR/secrets.gpg"
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 42)May include surrounding context.

sh
VAULT_DIR="$WORKSPACE/.vault"
VAULT_FILE="$VAULT_DIR/secrets.gpg"
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 45)May include surrounding context.

sh
VAULT_DIR="$WORKSPACE/.vault"
VAULT_FILE="$VAULT_DIR/secrets.gpg"
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 46)May include surrounding context.

sh
VAULT_DIR="$WORKSPACE/.vault"
VAULT_FILE="$VAULT_DIR/secrets.gpg"
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 47)May include surrounding context.

sh
VAULT_DIR="$WORKSPACE/.vault"
VAULT_FILE="$VAULT_DIR/secrets.gpg"
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 72)May include surrounding context.

sh
VAULT_DIR="$WORKSPACE/.vault"
VAULT_FILE="$VAULT_DIR/secrets.gpg"
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 23)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 43)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 52)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 54)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 60)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 62)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 70)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 75)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 92)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 128)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 135)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 141)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/vault.sh (reported line 184)May include surrounding context.

sh
VAULT_PASS_FILE="$VAULT_DIR/.passphrase"
KEYRING_LABEL="bma-vault"

_keyring_backend() {
  if [ -n "${BMA_VAULT_PASS:-}" ]; then
    echo "env"
  elif command -v secret-tool >/dev/null 2>&1; then

Static analysis

No suspicious patterns detected.