Skip to content

w3bs ask legal: sources-only prompt, never invent cases; 220-token cap - #282

Merged
sh1pt-actions-fleet[bot] merged 1 commit into
mainfrom
fix/legal-agent-strict-prompt
Nov 2, 2026
Merged

sh1pt-actions-fleet[bot] merged 1 commit into
mainfrom
fix/legal-agent-strict-prompt

Conversation

@sh1pt-actions-fleet

Copy link
Copy Markdown
Contributor

A live /api/v1/ask test of the new legal agent (#280) invented a Texas Supreme Court justice and three rulings. That is the worst failure for a legal agent.

The new system prompt: answer only from the numbered sources and cite them like [1]; never invent court cases, judges, statutes, dates or numbers; say so when the sources do not answer; name the jurisdiction; under 120 words; end by suggesting a licensed attorney. max_tokens 350 to 220 (the long answers were where it looped and invented).

Tested on the same adapter (dev3, chat.py with the same pit.world grounding) on the deposit question and a small-claims question: no invented authorities, attorney referral at the end. The 0.5B model still gets substance wrong at times; the disclaimer stays, and a larger base is the real fix.

Registry-only change: the CLI reads w3bs.org/agents.json at runtime.

🤖 Generated with Claude Code

Live test of the legal agent through /api/v1/ask invented a Texas Supreme Court
justice and three rulings. The stricter prompt (answer only from the numbered
sources, never invent cases, judges, statutes, dates or numbers, under 120
words, end with a licensed attorney) produced no invented authorities in the
same and a second question on the same adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sh1pt-actions-fleet
sh1pt-actions-fleet Bot merged commit 06ad658 into main Nov 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant