HR, Legal & Compliance
HR, Legal & Compliance Agents
High-stakes, document-heavy workflows that traditionally require expensive human expertise. These agents accelerate processing while maintaining the rigor required in legal and HR contexts.
π Active Use Cases
π CV Screening & Ranking Agent
An agent that processes a batch of CVs against a job description, scores each candidate on relevant criteria (skills match, experience level, career trajectory), and produces a ranked shortlist with structured justifications. It reduces screening time from days to minutes while enforcing consistent, bias-aware evaluation.
import PyPDF2
import json
from anthropic import Anthropic
client = Anthropic()
def extract_text_from_pdf(pdf_path: str) -> str:
with open(pdf_path, "rb") as f:
reader = PyPDF2.PdfReader(f)
return " ".join([page.extract_text() for page in reader.pages])
def score_candidate(cv_text: str, job_description: str) -> dict:
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
system="""You are an objective HR screening assistant. Evaluate candidates fairly based on skills and experience only.
Never consider: age, gender, nationality, or graduation year.
Return a valid JSON object.""",
messages=[{
"role": "user",
"content": f"""Job Description:
{job_description}
Candidate CV:
{cv_text[:3000]}
Return JSON:
{{
"overall_score": 0-100,
"skills_match": 0-100,
"experience_relevance": 0-100,
"strengths": ["...", "..."],
"gaps": ["...", "..."],
"recommendation": "Strong Yes / Yes / Maybe / No",
"summary": "2-3 sentence justification"
}}"""
}]
)
return json.loads(response.content[0].text)
jd = "Senior Python Engineer, 5+ years, distributed systems and cloud-native."
cv_text = extract_text_from_pdf("candidates/john_doe.pdf")
result = score_candidate(cv_text, jd)
print(result)Stack: Typeform + Make + Claude API + Airtable
- Collection: Candidates apply via a Typeform that accepts CV file uploads.
- Processing: Make triggers on new submissions, extracts PDF text via a parser module.
- Scoring: CV text + job description sent to Claude API. Structured JSON response is parsed.
- Database: Each candidateβs score, strengths, gaps, and recommendation stored in Airtable.
- Shortlist: An Airtable view automatically filters candidates with
overall_score >= 70for recruiter review.
π Contract Review & Risk Analysis Agent
An agent that reads contracts (NDAs, service agreements, vendor contracts) and identifies risky clauses: unfavorable liability caps, auto-renewal traps, IP ownership ambiguities, and missing standard protections. It produces a risk-ranked clause summary β a powerful first pass before legal review.
import PyPDF2
from anthropic import Anthropic
client = Anthropic()
RISK_FRAMEWORK = """
Evaluate these risk categories:
1. LIABILITY: Uncapped liability, indemnification breadth
2. IP: IP assignment scope, work-for-hire clauses
3. TERMINATION: Notice periods, termination for convenience, penalties
4. AUTO-RENEWAL: Renewal terms, opt-out windows
5. JURISDICTION: Governing law, dispute resolution location
6. DATA: Data ownership, privacy obligations, breach notification
"""
def review_contract(contract_text: str, company_name: str) -> str:
response = client.messages.create(
model="claude-opus-4-6",
max_tokens=4000,
system=f"""You are a contract review specialist reviewing on behalf of {company_name}.
{RISK_FRAMEWORK}
Flag issues as: π΄ HIGH RISK | π‘ MEDIUM RISK | π’ LOW RISK / Standard.
Always quote the exact contract language before explaining the risk.""",
messages=[{
"role": "user",
"content": f"Review this contract:\n\n{contract_text[:6000]}"
}]
)
return response.content[0].text
with open("contracts/vendor_agreement.pdf", "rb") as f:
reader = PyPDF2.PdfReader(f)
contract_text = " ".join([p.extract_text() for p in reader.pages])
report = review_contract(contract_text, "Acme Corp")
print(report)Stack: Make + PDF upload + Claude API + Notion + Slack
- Trigger: A new contract PDF is uploaded to a designated Google Drive folder.
- Extract: Make uses a PDF parser to extract the contract text.
- Review: The text is sent to Claude with the risk evaluation framework in the system prompt.
- Report: The risk report is saved as a Notion page tagged with contract type and risk level.
- Alert: If HIGH RISK clauses are found, a Slack alert is sent to the legal team immediately.
β Policy Compliance Checker
An agent that cross-references internal company policies against actual practices, documents, or requests to flag non-compliance. Use cases: checking expense reports against travel policy, validating vendor onboarding against procurement rules, or auditing communications for HR policy adherence.
from anthropic import Anthropic
client = Anthropic()
def check_compliance(document: str, policy_text: str, policy_name: str) -> str:
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1500,
system=f"You are a compliance officer reviewing documents against the '{policy_name}'. Be specific: cite exact policy rules. Return a structured analysis.",
messages=[{
"role": "user",
"content": f"""Policy ({policy_name}):
{policy_text[:2000]}
Document to check:
{document[:2000]}
Provide:
1. COMPLIANT items (with policy reference)
2. NON-COMPLIANT items (with policy reference and severity)
3. MISSING information required by policy
4. Overall verdict: COMPLIANT / PARTIALLY COMPLIANT / NON-COMPLIANT"""
}]
)
return response.content[0].text
travel_policy = open("policies/travel_expense_policy.txt").read()
expense_report = open("expense_reports/march_2026_john.txt").read()
result = check_compliance(expense_report, travel_policy, "Travel & Expense Policy")
print(result)Stack: Google Forms + Make + Claude API + Google Sheets + Email
- Submission: Employees submit expense reports or requests via Google Forms.
- Policy Fetch: Make retrieves the relevant policy document from Google Drive.
- Check: The submission and policy are sent to Claude for compliance analysis.
- Auto-route:
- COMPLIANT β auto-approved and logged in Google Sheets.
- NON-COMPLIANT β flagged with specific violations, routed to manager via email with Claudeβs analysis.