Recipe + prompt
Contract obligation agent
Contracts are checked regularly for deadlines, obligations, and renewals. Tasks appear in time.
- 01 Holdings
Contracts in the workspace
- 02 Extraction
Deadlines and parties
- 03 Calendar
Query due dates
- 04 Decision
Task only when needed
- 05 Notice
Inform in time
Implement as
- Starting point
- Renewal windows are found too late because nobody reads the holdings regularly.
- Automated result
- A daily run creates only new, idempotent tasks before the deadline.
- Inputs
-
- Contract PDF
- Schedule
- Due-date window
- Outputs
-
- Due dates
- Task
- Log
Flow
- 01Trigger via schedule or webhook
- 02Read GET /analytics/calendar-due-dates
- 03Run legal extract via workflow job when needed
- 04Derive tasks idempotently
- 05Send critical notices only after approval
- Authentication
- Server-side secret key (po_sk_)
po_sk_ only from the server environment. Never in the browser, prompt, or repository. Restrict rotation and access.
- MCP profile
- Endpoints
-
GET /analytics/calendar-due-datesPOST /job/add/workflowPOST /webhooks/subscribeGET /job/get/{job_id}
- Modules
-
- OCR
- Classify
- Webhook
- Workflow
- Permissions
- Calendar, workflow jobs, subscribe to webhooks. No billing-admin actions in the agent.
- Errors and approval
- Poll 202. Retry with backoff and a cap. Idempotency via document ID + deadline. Respect 429. HITL before external notification.
- Security
-
- po_sk_ environment only
- Idempotency required
- HITL before notification
- Verify webhook HMAC
Prompt for Autonomous agent
Read this first, in full:
https://api.paperoffice.ai/latest/docs/llms-full.txt
Task:
Implement an autonomous agent (cron or event) that checks contract deadlines. Chat is not the control surface.
Constraints:
- Base URL: https://api.paperoffice.ai/latest
- Authorization: Bearer from environment PO_API_SECRET (po_sk_…). Never in the frontend.
- Recurring, idempotent, retry with backoff, logging.
Only these endpoints:
- GET /analytics/calendar-due-dates
- POST /job/add/workflow (Extract legal document; file or pofid)
- GET /job/get/{job_id}
- POST /webhooks/subscribe (HMAC-SHA256, server-side only)
Rules:
- Do not create the same deadline task twice.
- External notices only after human approval.
- Abort on 401/403. 402 budget. 429 backoff. Poll 202. No endless retries. Do not invent endpoints. Do not put real keys in files. - mietvertrag-berlin-2024.pdf
- kündigungsfrist: 3 Monate zum Quartal
- nächste Frist: 2026-09-30
Expected result
due=2026-09-30, obligation=termination_window, task_created=true, notify=pending_hitl
Build or sell this solution with PaperOffice?
Integrator and Reseller can be combined. The next step is the partnership — application and instant decision continue in the PaperOffice app.
Start partnership