Mneme sits beside SAST and SCA. It replaces neither. SAST analyses source code for security flaws. SCA checks the packages you depend on for known vulnerabilities and licences. Mneme, an open-source tool, compiles rules from your architecture decision records (ADRs) and enforces them on code changes: in agent hooks, such as the one for Claude Code, before a write, and in continuous integration (CI). It matches exact text and named values in code changes, and it has no vulnerability rules. Keep your scanners, and add Mneme for the decisions your team wrote down.
Two different questions
The Open Worldwide Application Security Project (OWASP) describes source code analysis tools, which it says are also known as SAST tools, as tools that analyse source code or compiled code to help find security flaws. Its page on component analysis, whose software-only subset is commonly called SCA, says it will commonly identify known vulnerabilities in components and can identify each component’s licence.
Both work from shared knowledge of what is unsafe: vulnerability classes such as injection, and advisories against published packages. A scanner finding says the code or package matches a published risk.
Mneme works from your team’s own decisions. Say an ADR states that frontend code must not log user email addresses. That decision is local to your system, and no advisory database records it. mneme adr import compiles the ADR’s Constraints section into a rule, and mneme check returns PASS, WARN or FAIL against it. A Mneme finding says the change breaks a rule compiled from a decision your team approved.
Where each layer draws the boundary
| Dimension | SAST and SCA | Mneme HQ |
|---|---|---|
| Question | Is this code or package known to be unsafe? | Does this change break a rule compiled from the decisions we approved? |
| Input | SAST: source code, often analysed for data flow. SCA: dependency manifests, against vulnerability and licence data | The code change, plus rules compiled from ADR files in the repository |
| Where a rule comes from | The tool’s rule sets and advisory data, plus custom rules in the tool’s own configuration | The ## Constraints section of an ADR, compiled with mneme adr import |
| Match | Vulnerability patterns, data flow, known advisories, licence identifiers | Exact, case-sensitive text in named paths; words of a package name; numeric limits in Python |
| A finding names | The weakness, advisory or rule the tool matched | The ADR ID and its title |
What Mneme enforces, and what it does not
This is the scope of mneme-hq 0.11.0, the current release. The same table, with the runs behind it, is on the Architectural Security Governance use case.
One detail decides which rules run. mneme adr import writes the compiled rules to a memory file, .mneme/project_memory.json. Each mneme check takes a --query that describes the change, and Mneme retrieves the decisions whose words match it. Path-scoped literal and numeric rules run whatever the query says. A dependency rule for a package name of several words runs only when retrieval selects its decision.
| Concern | mneme-hq 0.11.0 | Detail |
|---|---|---|
| Exact text, optionally limited to paths | Enforced: FAIL | FORBID_LITERAL: a case-sensitive match on a code change, limited to the paths the rule lists with include_paths, or applied to every path when it lists none. It runs whatever --query says. |
| Numeric upper bound in Python | Enforced: FAIL | FORBID_NUMERIC_ABOVE: a module-level value or direct call argument in a .py file, read with --source-file. It runs in mneme check and CI. On an ordinary edit the Claude Code hook reports it unevaluated, so enforce it in CI. |
| Package name | Flagged: WARN | FORBID_DEPENDENCY: returns WARN, never FAIL. Strict mode still exits 1 on WARN, and the strict Claude Code hook refuses the write. No path scope, and it matches any single word of the name. A name of several words runs only when the query retrieves its decision. |
| Where it runs | mneme check, agent hooks, CI |
Hooks check native writes before they land: Claude Code’s Edit, Write and MultiEdit, Codex CLI’s apply_patch, and Kiro CLI 3.0’s write and append tools. The runs on this page use mneme check; the Claude Code hook is the one the security use case documents. |
| Vulnerabilities, taint and data flow | Not checked | No data-flow, call-graph or middleware analysis. Use SAST and code review. |
| Dependency CVEs (Common Vulnerabilities and Exposures) and licences | Not checked | No advisory or licence data. Use SCA. |
| Secrets by pattern | Not checked | A literal rule matches only the exact text you write into it. |
| Personal data or auth flow by meaning | Not checked | A renamed variable passes a literal rule, as the run below shows. |
| Infrastructure and network policy | Not checked | Mneme enforces rules on code changes only. |
| Runtime behaviour | Not checked | Nothing in Mneme watches running code or limits which tools an agent calls. Runtime governance is a research area. |
One decision, run on mneme-hq 0.11.0
The runs below come from mneme-hq 0.11.0 in a clean virtual environment on 30 November 2026. We dropped the cd into the fixture repository, shortened the path to the mneme executable, quoted the --query value, and dropped output separators. ADR-102 forbids one exact line, and only under src/frontend/:
## Constraints
- FORBID_LITERAL:
value: console.log(user.email)
include_paths:
- "src/frontend/**"
$ mneme check --memory .mneme/project_memory.json --input src/frontend/login_bad.ts --query "frontend dashboard security data access" --mode strict
FAIL [ADR-102] FORBID_LITERAL "console.log(user.email)" -- trigger: console.log(user.email)
Frontend must not log user email addresses
path: src/frontend/login_bad.ts via src/frontend/**
PATH APPLIED [ADR-102] src/frontend/login_bad.ts via src/frontend/** -- an include selector matched
Result: FAIL
$ mneme check --memory .mneme/project_memory.json --input src/backend/login_same_pattern.ts --query "frontend dashboard security data access" --mode strict PATH EXCLUDED [ADR-102] src/backend/login_same_pattern.ts -- no include selector matched Result: PASS
$ mneme check --memory .mneme/project_memory.json --input src/frontend/login_nearmiss.ts --query "frontend dashboard security data access" --mode strict PATH APPLIED [ADR-102] src/frontend/login_nearmiss.ts via src/frontend/** -- an include selector matched Result: PASS
The first run fails and names ADR-102. The same line under src/backend/ passes, since the rule covers only src/frontend/**. The renamed variable in login_nearmiss.ts also passes: the email still reaches the console, but the exact text never appears.
Following a value through variables is data-flow analysis, which many SAST tools offer once a rule defines the source and sink. Semgrep’s taint mode, for example, tracks data from sources you define and reports a finding when it reaches a sink. Mneme has no such rule kind.
Where custom SAST rules overlap
Some SAST tools accept custom rules, so a scanner can enforce ADR-102 too. A Semgrep rule is written in YAML, matches code with a pattern, and can be limited to files with a paths: key. You could write the ADR-102 rule there instead.
The differences are where the rule lives and when it runs. In Mneme the rule sits in the ADR, next to the reasoning, and changes through the same pull request as the decision. A violation prints the ADR’s ID and title. The Claude Code hook evaluates the rule before an Edit, Write or MultiEdit call changes a file, and in strict mode, its default, it refuses a write that produces WARN or FAIL. If your scanner already holds the rule and your team is content with that, Mneme adds little for that rule.
For dependencies, SCA does more. GitHub’s dependency review shows licence, dependents and age for changed dependencies, and its action can block a pull request on listed licences. A Mneme FORBID_DEPENDENCY rule only warns when a word of a package name appears in a file.
Examples in each category
These four tools are described from their own documentation.
- Semgrep (SAST). Rules in YAML with pattern operators, plus taint mode for tracking untrusted data from sources to sinks.
- CodeQL (SAST). A language and toolchain for code analysis that queries a database extracted from a codebase. Its docs say many of its security queries implement data-flow analysis.
- Dependabot alerts (SCA). Alerts on vulnerable dependencies, based on advisories in the GitHub Advisory Database.
- GitHub dependency review (SCA). Licence and vulnerability information on the dependencies a pull request changes, with an action that can fail the pull request.
Running them together
- Keep SAST in CI for vulnerability classes and data flow. A taint rule that treats
user.emailas a source andconsole.logas a sink can follow the renamed variable above, if you write or enable one. - Keep SCA for advisories and licences on the packages you pull in.
- Add Mneme for your decisions. Write each security decision as an ADR with a Constraints section, create the memory file with
mneme initand import it withmneme adr import, add the Claude Code hook, and runmneme check --mode strictas a CI step. Strict mode exits 0 on PASS, 1 on WARN and 2 on FAIL. Warn mode exits 0 on any verdict, but still exits 2 onResult: INCOMPLETEor an error. The CI how-to guide has a GitHub Actions workflow. - Numeric rules affect other checks. In 0.11.0, once a memory file holds a numeric rule, every
--inputcheck against it exits 2 and reports the evaluation incomplete (Result: INCOMPLETE, orResult: FAIL (evaluation incomplete)when another rule fails), in warn mode too, wherever the file sits. Check Python files for numeric rules with--source-file.
Mneme has no integration with SAST or SCA tools.
| Layer | Answers | Does not answer |
|---|---|---|
| SAST | Does this code contain a known class of security flaw? | Whether a change follows a decision only your team made, unless you write that rule into the tool |
| SCA | Does this dependency carry a known vulnerability or a licence we refuse? | Whether code outside the dependency manifest breaks an architecture decision |
| Mneme HQ | Does this change contain text, a package name or a Python value that an approved ADR forbids? | Whether code is vulnerable, whether a package has a CVE, or what the code means |