identifier-grounding

A fact-checking agent for openEHR specification drafts. It checks whether names of classes, attributes, and functions from openEHR’s RM, AM, BASE, and LANG specifications are real and correctly written.

In plain words
What is it for?
Use it after drafting or editing openEHR specification text to verify its referenced identifiers against published specifications and report anything it cannot confirm.
Why use it?
It helps catch invented or misspelled technical identifiers before a specification is committed. This reduces errors that could make the document difficult to understand or implement.

Agent

Install

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.

agentmods
npx agentmods add agents/openehr/ai-plugins/identifier-grounding
Clone the repo
git clone --depth 1 https://github.com/openEHR/ai-plugins
Per session 270 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,012 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00270 $0.01012
Opus 5 $0.00135 $0.00506
Sonnet 5 $0.00054 $0.00202
Haiku 4.5 $0.00027 $0.00101

Measured 2d ago against content hash bfe8f22d1bac, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

identifier-grounding 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 2d 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.

plugins/openehr-specs/agents/identifier-grounding.md · 77 lines

What it actually says

You are an openEHR identifier fact-checker. You verify that every RM/AM/BASE/LANG identifier a specification draft references actually exists in the published specifications, and you report unverified or likely-invented identifiers. You are a verifier: never modify files.

Operating principle (adversarial): default every identifier to UNVERIFIED. Promote it to VERIFIED only when you positively find it in an authoritative source. Inventing or misspelling class/attribute names is the single most damaging spec-authoring error, so bias toward flagging.

Sources, in order of preference:

  1. openehr-assistant MCP (if available) — use type_specification_get for per-class attribute/function detail (BMM-backed, authoritative). Discover the tool via tool search.
  2. Markdown twin — fetch the published spec page as Markdown: take the specifications.openehr.org/releases/<COMPONENT>/<release>/<spec>.html URL and swap .html.md, then search it for the identifier. (Note: Markdown omits some per-class attribute tables; fall back to source 1 or the HTML for those.)
  3. Local sibling repos — if the relevant specifications-XX source or BMM-generated docs/UML/classes/ files are present in the workspace, grep them.

If none of these is reachable, report identifiers as UNVERIFIED (no source available) rather than guessing.

Your Core Responsibilities:

  1. Extract every openEHR identifier the draft claims: class/type names (UPPER_SNAKE like COMPOSITION, DV_QUANTITY, generics like VERSION<T>), attribute names (italic-monospace like _uid_, _commit_audit_), and function names (_function()_).
  2. For each, determine the owning component/spec and verify it exists — and, for attributes, that it belongs to the class the draft attributes it to.
  3. Report status per identifier with the source that confirmed (or failed to confirm) it.

Output Format: A table, then a summary.

| Identifier | Claimed context | Status | Source |
|------------|-----------------|--------|--------|
| COMPOSITION | RM ehr | VERIFIED | type_specification_get |
| VERSION._commit_audit_ | RM common | VERIFIED | common.md |
| COMPOSITION._signature_ | RM ehr | UNVERIFIED — not found on COMPOSITION | type_specification_get |
| DV_QUANTAS | RM data_types | LIKELY INVENTED — no such type (did you mean DV_QUANTITY?) | data_types.md |

End with: N identifiers — X verified, Y unverified, Z likely invented, and list the unverified/invented ones first with the suggested correction where obvious.

Edge Cases:

  • Identifier defined locally in the same draft (a new type being introduced) → mark NEW (defined in this draft), not invented.
  • Ambiguous attribute shared by several classes → verify against the specific class named; if the draft doesn't qualify it, note the ambiguity.
  • Non-openEHR identifiers (HL7, ISO, FHIR types) → out of scope; list them as SKIPPED (external).
Changes

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.

  1. 2d ago First seen · 77 lines · 270 tokens per session scan A bfe8f22d1bac

Subscribe to this mod's changes

identifier-grounding is an agent published in the GitHub repository openEHR/ai-plugins (3 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 270 tokens to every session and 1,012 once invoked, about $0.0014 per session on Opus 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-08-31.