Skip to content

Frondly support agent with deterministic policy guards#2

Open
ishmeet1995 wants to merge 1 commit into
betterup:mainfrom
ishmeet1995:assignment
Open

Frondly support agent with deterministic policy guards#2
ishmeet1995 wants to merge 1 commit into
betterup:mainfrom
ishmeet1995:assignment

Conversation

@ishmeet1995

Copy link
Copy Markdown

Summary

Frondly customer support agent for the ai-agent-engineer take-home: an Anthropic tool-use loop (solution/agent.py) that reads the Customer
Care Guide verbatim as its system prompt, with deterministic Python guards — not just prompting — enforcing the two highest-stakes actions
(refund issuance, subscription/account changes): identity verification, the $50/conversation refund ceiling, and a one-way escalation lock.

  • Policy compliance: 339/339 automated checks passed (100%) across all 18 conversations x 3 runs (54 transcripts), scored by
    solution/eval.py against a rubric derived from policy/cs-guide.md and each conversation's script.
  • Helpfulness: 100% substantive, on-topic reply rate plus per-conversation content checks (care advice given, multi-part asks addressed,
    referral scripts present).
  • Stability: 15/18 conversations identical tool-action signature across all 3 runs. The 3 that varied did so only on discretionary judgment
    calls (e.g. whether to file a non-mandated escalation for a shipment stuck at "shipped"), never a hard-rule violation.

Full design rationale + Mermaid architecture/flow diagrams: solution/ARCHITECTURE.md. Half-page summary, eval results, and what I'd harden
next: WRITEUP.md. AI-tool disclosure: AI_USE.md.

What's included

  • solution/agent.py — the agent (respond(session, message) -> str)
  • solution/eval.py — policy compliance / helpfulness / stability scoring
  • solution/ARCHITECTURE.md — design doc with component + request-flow diagrams
  • solution/artifacts/ — committed snapshot of the graded 3x run: 54 transcripts, conversation-tagged tool-call log, tool outbox, eval report
  • CLAUDE.md — dev-session guidance and the design decisions baked into the guard layer
  • WRITEUP.md, AI_USE.md — write-up and AI-tool disclosure per SUBMISSION.md
  • pyproject.toml / uv.lock — dependency management via uv; formatting via black + isort

requirements.md (a fuller, production-style spec I drafted separately) is kept in the repo as reference but was deliberately not the
driving spec for this submission — see AI_USE.md for why.

Test plan

  • uv sync installs cleanly from a clean checkout
  • uv run harness.py --repeat 3 runs all 18 conversations 3x with no crashes or unhandled API errors
  • uv run solution/eval.py reports 339/339 policy checks passed, 100% helpfulness, 15/18 conversations action-stable
  • Manually spot-checked adversarial conversations (prompt injection, impersonation, fake VP authorization, serial-refund salami-slicing,
    safety/ingestion) against policy/cs-guide.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant