AI Investigation Agent
Flex runs an internal Slack agent that support, operations, and engineering use to debug HSA and FSA payment problems. Given an email, order number, or error string, it traces the transaction across systems and answers in plain English. On high-confidence bugs it opens a pull request for review.
- Company
- Flex
- Approach type
- Agent
- Work
- Finance ops, On-call, Coding
- Human involvement
- Drafts reviewed
- Invocation
- Interactive
- Interfaces
- Slack
- Deployment stage
- Deployed
- Evidence strength
- Detailed primary
- Entry reviewed
How it works
Slack request through transaction trace, confidence gate, and reviewed pull request.
A universal resolver maps an email, order number, transaction ID, or ticket to the relevant records, and the agent walks the transaction lifecycle across payments, refunds, consultations, webhooks, and payouts[Source 1]
When something looks wrong the agent pulls provider responses and real-time payment state, searches production logs, and inspects error traces and the source code around the failure[Source 1]
The agent verifies the failure mode in the affected code path and assesses its confidence before taking any action[Source 1]
The agent creates an engineering ticket and a coding sub-agent clones the repository, applies the fix, and opens a pull request posted back to the Slack thread[Source 1]
Where people stay involved
People review, approve, or guide the agent’s work here.
Reported: High-confidence fixes return as a pull request posted for review; the agent never merges or deploys.
Supervision level
Work-product review
A person reviews the draft or implementation.
Level 3 of 5
- payment investigation → proposed code fix[Source 1]
Implementation details
- Model
- Anthropic (named for the tool-calling investigation loop and the coding sub-agent); specific model version not named[Source 1]
- Harness
- Investigation-to-fix loop running as a serverless application on Modal; Slack requests are acknowledged, the investigation runs in a spawned background function, and fixes come from a spawned coding sub-agent[Source 1]
- Sandbox
- Not reportedThe capture names the Modal serverless runtime but no execution isolation boundary.
- Tool access
- Traces a payment end-to-end across payment systems; can open a PR with a proposed fix when a bug is found[Source 1]
- Knowledge
- Not reportedRecords arrive through scoped tools (a read-only replica, payment infrastructure, logs, Sentry, Linear, GitHub, PostHog); no separate knowledge store is documented.
- Context management
- Follow-up questions continue in the same Slack thread with full context; investigation length and thread depth are capped[Source 1]
- Credentials
- Not reportedSlack request verification and log redaction are named; how the agent authenticates to connected systems is not documented.
- Interfaces
- slack
Mechanisms
Payment trace → root-cause hypothesis → proposed code fix as a PR[Source 1]
Validation and failure handling
The coding sub-agent runs compile checks, linting, formatting, and tests before opening the pull request[Source 1]
Reported observations
These results come from the sources. Notes below each result explain what it covers and any reported limits.
Flex reports routine investigations compressed from about 20 minutes of engineering time to seconds[Source 1]
Routine HSA and FSA payment investigations handled by the internal agent
About this result
- Category
- Cost latency
- Evidence type
- Qualitative
- What it covers
- Routine HSA and FSA payment investigations handled by the internal agent
Lessons
Flex retains investigation audit records and tool traces that engineers can inspect when a diagnosis is incomplete or wrong.[Source 1]
Flex routes high-confidence diagnoses to a coding sub-agent and PR review, medium-confidence cases to an engineering ticket, and inconclusive cases to a report.[Source 1]