Repository navigation
feat(legal): add an agent for negotiation follow-ups against the playbook - #31
Merged
Merged
Conversation
…book agent.py lets a lawyer ask follow-up questions on one NDA: what the playbook allows when the other side rejects a position, whether new wording meets it, and a reply draft. Its tools wrap the workflow, and the tool, not Claude, puts a revised clause back into the full NDA before checking it. Code checks every answer and reply. The term position gains one fallback in rules.yaml, which the workflow ignores; its results are unchanged. 14 of 15 conversations came out as expected over 5 runs each. The verifier passes a "for so long as it remains a trade secret" tail; the README reports it as a gap in the workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The post isn't published yet, so its links returned 404, and its claims will change in the blog update. The README now links the root README's test and states each point on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Checked wording counts only for a position whose cited section it replaced or whose status it turned into a match, and only when no position came out worse than in the review; every position open in the review or the latest clause check must be in the draft. - lawyer_to_confirm is refused when the review or the latest check says deviates. - A reply body that accepts a position (agent.acceptance words, not negated just before the word, not a question) fails unless the table marks it agreed or proposed; README narrowed to what this catches. - A clause check grounds a duration or place only from rows that came out a match. - Single-quoted spans are checked as quotes too. - Draft bodies and answers are fenced; table cells, warnings, questions and tool arguments go through md_safe. - Tool arguments are validated against the signature; errors inside a tool raise instead of becoming "Bad arguments". - The note's clause quote uses agent.quote_min_words; asking about a position not checked for our role is a check problem, not a crash. - An answer or draft bundled with tool calls goes back to Claude unshown. - The status comes from a draft for the latest draft request. - Transient Claude errors (incl. timeouts, 408, 409) stop the turn; any other stops the run, message first; cost priced on response.model. - README: "recipe.decide twice" only when a fallback applies; agent numbers from five live reruns after the fixes (14 of 15). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rparundekar
force-pushed
the
feat/agent-legal
branch
from
November 11, 2026 02:50
a0b27d5 to
a4312dc
Compare
Collaborator
Author
Self-reviewTwo review passes ran on this PR. One read the code: correctness, silent failures, tests and comments. The other covered security and checked the README against the code. Every finding below was fixed in cab8e86. Each fix has a selfcheck case that fails if the fix is undone, and the reviewers' own repro scripts now raise a warning on every case. Important (5, all fixed)
Suggestions (all fixed)
Reruns after the fixes (5 live runs per conversation)14 of 15 came out as expected.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds
agent.pybeside the playbook review. A lawyer mid-negotiation asks follow-up questions:The tool, not Claude, puts a revised clause back into the full NDA before checking it. Corrin's new Section 7 passes in context, and on its own the check can't settle it (
unclear). Code checks every answer and reply draft. The term position gets one fallback inrules.yaml. The workflow ignores that fallback, and its results are unchanged.Live results (5 runs each, using SIE Serverless, 10 Nov 2026)
14 of 15 conversations came out as expected. The first batch was 10 of 15 because of a bug in the tool, which was fixed in the tool rather than the prompt. The README reports both batches.
Depends on the docs PR.
🤖 Generated with Claude Code