Sequential AgentLegalintermediate

Legal Invoice Auditor

Acts as · Legal Billing Analyst

Reviews outside counsel invoices line-by-line against billing guidelines, flags excessive hours, block billing, vague descriptions, unauthorized timekeepers, rate violations, and duplicate entries. Calculates recommended adjustments, updates the legal spend tracker in Google Sheets, and emails audit results to the billing partner.

A single-purpose agent that runs an ordered list of tasks against your tools, knowledge and tables, the same way every run.

Official~8 min setupby Akshay Gupta
How it works

Inputs in, an ordered run, a result out.

A Sequential Agent takes typed inputs, runs its tasks top to bottom against your tools and tables, and returns a structured result, the same way on every run.

Typed inputs
Values you pass in, validated before the run spends anything.
5 tasks
Each task runs in order, passing its output to the next.
Tools & tables
2 tools
Result + trace
A structured output, with every step recorded.
The run loop
ReadPlanActCheckWriteTracerepeats until done

What's inside

Everything this template installs, by name.

Tools2
Google SheetsGmail
Tasks
5 ordered tasks

What it takes in

The inputs you provide on each run, validated before anything executes.

InputTypeRequired
Invoice DatainvoiceDataLong textOptional
Firm NamefirmNameShort textOptional
Matter NumbermatterNumberShort textOptional
The work, step by step

5 tasks, run in order.

Each task passes its result to the next. Here's what each does and what it produces.

  1. 01
    Parse {{invoiceData}} from {{firmName}} for matter {{matterNumber}}. Extract every time entry: date, timekeeper name, timekeeper role (Partner/Associate/Paralegal), hours, rate, amount, and task description. Also extract all expense entries with amounts and descriptions.
    Expected output
    JSON object: {firm, matter, invoice_number, invoice_date, time_entries: [{date, timekeeper, role, hours, rate, amount, description}], expenses: [{date, description, amount}], total_fees, total_expenses, total_invoice}
  2. 02
    Validate each timekeeper against the approved rate card for {{firmName}} from the knowledge base. Flag any timekeeper not on the approved list or billing above their approved rate. Calculate the overcharge amount per violation.
    Expected output
    JSON array: [{timekeeper, billed_rate, approved_rate, difference, total_hours, total_overcharge, status (approved/unapproved/rate_violation)}]
  3. 03
    Audit each time entry against the Outside Counsel Billing Guidelines. Check for: block billing (multiple tasks in one entry over 2 hours), vague descriptions, excessive hours for task type, administrative tasks at attorney rates, duplicate entries (same date/description/hours), and weekend/holiday work without pre-approval.
    Expected output
    JSON array of violations: [{entry_date, timekeeper, hours, amount, violation_type, guideline_reference, recommended_adjustment, explanation}]
  4. 04
    Use Google Sheets named Legal Invoices to update the legal spend tracker: add new rows for each invoice line item, update the running total for {{firmName}} and {{matterNumber}}, calculate year-to-date spend, and update the violations dashboard with trending data.
    Expected output
    Tracker update confirmation: {rows_added, ytd_spend_firm, ytd_spend_matter, total_violations_this_invoice, historical_violation_rate_firm}
  5. 05
    Use Gmail to create a draft to audit results to the billing partner at {{firmName}}. Email includes: invoice summary, total recommended adjustments with line-item detail, specific guideline references for each disputed entry, and request for revised invoice within 15 business days.
    Expected output
    Email sent confirmation: {recipient, subject, adjustment_amount, disputed_entries_count, revised_invoice_due_date}

Tools it uses

Google SheetsGoogle Sheets
GmailGmail

What you can do with it

Invoice Compliance Check
Ensures invoices meet strict billing guidelines
Excessive Hours Flagging
Identifies and flags excessive billed hours
Rate Violation Alerts
Detects unauthorized rate discrepancies instantly
Automated Audit Reporting
Generates and emails audit results efficiently

Related templates