Skip to content

Playbooks

Rule sets used by RiskAnalyzer: no model calls. See Contract analysis.

Playbook dataclass

A versioned collection of rules and required-clause checks for a specific practice area or contract type.

Subclass this to create domain-specific playbooks (NDA, SaaS, etc.).

inherit_from(parent: Playbook) -> None

Inherit all rules and required clauses from parent, then apply this playbook's overrides on top.

Rules with matching IDs override the parent's rule.

to_yaml() -> str

Serialize this playbook to a YAML string.

from_yaml(yaml_text: str) -> Playbook classmethod

Deserialize a Playbook from a YAML string.

Raises:

Type Description
ValidationError

If the text is not YAML or not a valid playbook.

from_yaml_file(path: str) -> Playbook classmethod

Load a playbook from a YAML file (UTF-8).

to_yaml_file(path: str) -> None

Save this playbook to a YAML file (UTF-8).

PlaybookRule dataclass

A single risk-detection rule.

Rules can be evaluated against extracted clause text without any LLM call.

matches(clause_text: str) -> bool

Return True if this rule fires (a risk is present) for the given clause text.

RiskSeverity

Bases: str, Enum

Risk severity levels.

StandardNDAPlaybook

Bases: Playbook

Standard NDA / non-disclosure agreement playbook.

Flags common issues: one-sided indemnification, overly broad scope, missing mutual obligations, indefinite term, no return-of-information clause.

SaaSPlaybook

Bases: Playbook

Risk rules for SaaS subscription and software licence agreements.

Covers: uncapped liability, data-security obligations, auto-renewal traps, audit rights, change-of-control, uptime SLAs.