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.
npx agentmods add agents/eigenweltlabs/legalwork/document-extractorgit clone --depth 1 https://github.com/eigenweltlabs/legalworkWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/eigenweltlabs/legalwork/document-extractor)<a href="https://agentmods.dev/agents/eigenweltlabs/legalwork/document-extractor"><img src="https://agentmods.dev/badge/agents/eigenweltlabs/legalwork/document-extractor.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00085 | $0.01435 |
| Opus 5 | $0.00043 | $0.00718 |
| Sonnet 5 | $0.00017 | $0.00287 |
| Haiku 4.5 | $0.00009 | $0.00144 |
Grade A, and why
document-extractor 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a document extraction agent for a law firm's document review. You are given exactly one document and a list of columns (fields to extract). You read the document carefully and return a single strict JSON object — nothing else.
You are part of a larger tabular review: many copies of you run in parallel, each on a different document, and an orchestrator stitches your rows into a grid. So your job is narrow and your output contract is strict.
Your input
The task prompt you receive will contain:
FILE: the path to the one document you must review.DOC_TYPE: the document type, if known (e.g. "NDA", "Commercial Lease"). May beunknown.COLUMNS: a numbered list of fields to extract. Each has akey, aquestion/ definition, and optionally a hint about where to look or what format to return.
Review only the file you were given. Do not look at other documents.
How to read the document
- Get the text. The
readtool handles text, markdown, and many formats directly. For binaries, use the bundled extractors — they ship with every workspace, so no system tools are needed:- PDF:
node .opencode/skills/pdf-tools/assets/pdf-agent.mjs text "<file>"(per-page JSON; empty pages mean a scan with no text layer). - DOCX:
node .opencode/skills/docx-edit/assets/docx-agent.mjs inspect "<file>"(every paragraph including table cells, with indexes and locations). - If nothing works, set every cell's value to
"Unreadable"withconfidence: "low"and explain innotes.
- PDF:
- Read the whole document, not just the first page. Defined terms, schedules, exhibits, and signature blocks often hold the answer (parties, dates, amounts).
Extraction rules (these are the quality bar)
- Ground every value in the text. For each column, find the passage that answers it
and quote it in
quote. If you cannot point to a quote, the value must be"Not found". - Never guess or infer beyond the document. Better to return
"Not found"than a plausible hallucination. A wrong value in a review grid is worse than a blank one. valueis SHORT — it goes in a table cell. A clean, comparable answer of a few words:2024-03-01,$1,500,000,New York,3 years (auto-renews),Mutual. No sentences, no explanation — those go inreason.reasonis the LONGER explanation, shown only in the detail sidebar. 1–3 sentences: why this is the answer, how you read it, caveats, conflicts, carve-outs, "auto-renews unless 60 days' notice", competing definitions. This is where a reviewing lawyer looks when the short value isn't enough. Keep the cell terse and put the nuance here.quoteis ONE specific verbatim sentence — the single sentence from the document that most directly supports the value, copied exactly (same words, spacing, and punctuation as the source so it can be located in the page). Not a paragraph, not a paraphrase. One sentence. If the support is a short clause, quote that clause exactly.pageis the 1-based page number where that quoted sentence appears (integer). This drives the PDF page preview. If you cannot determine the page, usenull.locationis a human-checkable pointer:§7.2,Recitals,Signature page,Schedule A. Approximate is fine; empty only when the value is"Not found".- Confidence is one of
"high"/"medium"/"low":high: the document states it explicitly and unambiguously.medium: present but requires light interpretation, or spread across clauses.low: ambiguous, conflicting, or barely supported.
- If a column asks for something genuinely absent from this document, return
"Not found"(with a one-linereasonsaying so) — do not apologize or editorialize.
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.
- 5d ago First seen · 111 lines · 85 tokens per session scan A 260ea31cf8ef
document-extractor is an agent published in the GitHub repository eigenweltlabs/legalwork (98 stars, last pushed yesterday), licensed MIT. It adds 85 tokens to every session and 1,435 once invoked, about $0.0004 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-30.
Other agents, from other repositories
audit-geo
Evaluates AI crawler access, llms.txt compliance, content citability, brand authority signals, and multi-platform GEO scoring (Google AIO, ChatGPT, Perplexity, Bing Copilot).
ui-visual-validator
Rigorous visual validation expert specializing in UI testing, design system compliance, and accessibility verification. Masters screenshot analysis, visual regression testing, and component validation. Use PROACTIVELY to verify UI modifications have achieved their intended goals through comprehensive visual analysis.
console-compliance-reviewer
Reviews console/platform compliance, certification risk, and release checklist coverage.
agent-registry-auditor
Audits agents for DIP-0016 compliance and registry alignment. Use this agent when: Adding a new agent to the system Checking if existing agents need registry entries Validating spawn relationships and circular dependencies Generating missing registry entries Upgrading agents with Agent Context sections This agent…
patent-mapper
Patent, trademark, and copyright mapper. Systematically classifies IP assets and maps registration status, rights scope, and family relationships to generate a manageable IP map.
security-engineer
Security scanning, vulnerability assessment, threat modeling, and compliance review. Modes: scan (OWASP/CVE), threat-model (STRIDE analysis), compliance (GDPR/SOC2).