These recipes provide approval workflows for legal operations, with focus on document control, audit trails, and compliance requirements.
- Contract Review
- Court Filings
- Document Classification
- Legal Hold
Contract Review
Manage AI-generated contract reviews with legal oversight.Copy
const reviewContract = needsHumanApproval({
type: 'async',
title: 'Contract Review',
ask: (args) => `Review AI-generated contract for ${args.clientName}`,
autoApprove: async (args) => args.riskLevel === 'LOW'
})
When to use this
When to use this
- AI-generated contract review
- Template deviation approval
- High-value contract oversight
- Non-standard term review
Best practices
Best practices
- Include comprehensive risk analysis
- Highlight template deviations
- Maintain approval audit trail
- Document review decisions
Court Filing Review
Manage court filing approvals with deadline awareness.Copy
const reviewCourtFiling = needsHumanApproval({
type: 'sync',
title: 'Court Filing Review',
ask: (args) => {
const deadline = new Date(args.filingDeadline);
const hoursLeft = Math.round((deadline - new Date()) / (60 * 60 * 1000));
const urgent = hoursLeft < 24 ? `⚠️ URGENT (${hoursLeft}h left): ` : '';
return `${urgent}Review ${args.filingType} for case ${args.caseNumber}`;
},
approvalArguments: {
filingType: {
type: 'string',
value: args.filingType,
label: 'Filing Type',
editable: false
},
jurisdiction: {
type: 'string',
value: args.jurisdiction,
label: 'Jurisdiction',
editable: false
},
content: {
type: 'longString',
value: args.filingContent,
label: 'Filing Content',
editable: true
},
citations: {
type: 'longString',
value: args.citations,
label: 'Citations Check',
editable: true
},
deadline: {
type: 'date',
value: args.filingDeadline,
label: 'Filing Deadline',
editable: false
}
},
// Route to jurisdiction experts
approvers: (args) => {
const jurisdictionExperts = {
'CA': { name: 'California Team', email: '[email protected]' },
'NY': { name: 'New York Team', email: '[email protected]' }
};
return [jurisdictionExperts[args.jurisdiction] ||
{ name: 'Legal Team', email: '[email protected]' }];
}
})
Approval timeout is automatically adjusted based on filing deadlines to ensure timely reviews.
Document Classification
Approve AI-suggested document classifications and retention policies.Copy
const classifyDocument = needsHumanApproval({
type: 'async',
title: 'Document Classification',
ask: (args) => `Review classification for document ${args.documentId}`,
approvalArguments: {
suggestedClass: {
type: 'string',
value: args.aiClassification,
label: 'AI Classification',
editable: true
},
confidence: {
type: 'number',
value: args.aiConfidence,
label: 'AI Confidence Score',
editable: false
},
retention: {
type: 'string',
value: args.retentionPolicy,
label: 'Retention Policy',
editable: true
},
keywords: {
type: 'string',
value: args.extractedKeywords.join(', '),
label: 'Extracted Keywords',
editable: true
}
},
// Auto-approve high-confidence classifications
autoApprove: async (args) => args.aiConfidence > 0.95
})
Classification Types
Classification Types
- Privileged communications
- Confidential materials
- Public records
- Discovery documents
- Internal memos
Legal Hold Management
Handle legal hold implementations and modifications.Copy
const manageLegalHold = needsHumanApproval({
type: 'sync',
title: 'Legal Hold Management',
ask: (args) => `Approve ${args.action} legal hold for matter ${args.matterId}`,
approvalArguments: {
scope: {
type: 'longString',
value: args.holdScope,
label: 'Hold Scope',
editable: true
},
custodians: {
type: 'longString',
value: args.custodians.join('\n'),
label: 'Affected Custodians',
editable: true
},
duration: {
type: 'string',
value: args.estimatedDuration,
label: 'Estimated Duration',
editable: true
},
holdReason: {
type: 'string',
value: args.reason,
label: 'Hold Reason',
editable: true
}
},
// Always require approval for hold removal
shouldSeekApprovals: async (args) => {
return args.action === 'REMOVE' || args.custodians.length > 10;
},
// Notify compliance team
onApprovedCallbackUrl: 'https://compliance.company.com/legal-hold-notification'
})
Critical Actions
Critical Actions
- Hold implementation
- Scope modifications
- Custodian additions/removals
- Hold termination