Skip to content

Instantly share code, notes, and snippets.

@ricardocasares
Created May 4, 2026 07:43
Show Gist options
  • Select an option

  • Save ricardocasares/a5786b295e5cae56932a1a417cc6188d to your computer and use it in GitHub Desktop.

Select an option

Save ricardocasares/a5786b295e5cae56932a1a417cc6188d to your computer and use it in GitHub Desktop.
Agent Markdown Files Explainer

SOUL.md

The clean separation model1 soul.md = Constitution (Non-Negotiable Rules)

This is NOT personality fluff.

This is where you define:

  • Trust boundaries (what is untrusted input)
  • What tools can / can’t do
  • What requires approval
  • Security invariants
  • Cost guardrails
  • Memory rules

This file should almost never change.

If soul.md changes often, your system doesn’t have stable identity.

Think of it as the control plane.

USER.md

user.md = The Human Profile + Working Contract

It should include:

  • Role / background (if relevant)
  • Long-term goals
  • Communication style preferences
  • How you want outputs formatted
  • Risk tolerance
  • Tool familiarity

Example stuff that makes sense:

  • “Prefers step-by-step instructions”
  • “Wants rollback plans for config changes”
  • “Comfortable reviewing diffs”
  • “Timezone: UTC+13”
  • “Building infra-heavy automation”

This helps the agent personalize without storing unnecessary personal data.

What doesn’t belong there:

  • Secrets
  • Emotional journaling
  • Sensitive private info
  • Random conversation fragments

user.md is stable identity + operational preferences.

MEMORY.md

3 memory.md = Curated, Durable Facts

This one should be small and structured.

Not a dumping ground.

Good things to store:

  • Environment facts (VM, OS, version)
  • Stable operator preferences
  • Guardrail decisions
  • Constraints
  • Known infrastructure setup

Each entry should ideally include:

  • Source
  • Date added
  • Last validated
  • Expiry (if applicable)

If you don’t expire memory, it becomes technical debt.

The Big Mistake Most People Make

Letting untrusted content (Reddit posts, web scrapes, tool output) modify identity files directly.

That’s how memory poisoning happens.

Better pattern:

  • Agent generates a proposal
  • Human reviews
  • Then merges into memory.md or user.md

Never auto-write identity files.

The mental model that finally clicked

  • soul.md = What the agent is allowed to be
  • user.md = Who the human is + how they want to work
  • memory.md = Verified long-term facts

If those lines blur, the system becomes unpredictable.

If those lines stay clean, the agent feels stable and controllable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment