Frondly support agent with deterministic policy guards#2
Open
ishmeet1995 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Frondly customer support agent for the
ai-agent-engineertake-home: an Anthropic tool-use loop (solution/agent.py) that reads the CustomerCare 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.
solution/eval.pyagainst a rubric derived frompolicy/cs-guide.mdand each conversation's script.referral scripts present).
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 hardennext:
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 scoringsolution/ARCHITECTURE.md— design doc with component + request-flow diagramssolution/artifacts/— committed snapshot of the graded 3x run: 54 transcripts, conversation-tagged tool-call log, tool outbox, eval reportCLAUDE.md— dev-session guidance and the design decisions baked into the guard layerWRITEUP.md,AI_USE.md— write-up and AI-tool disclosure perSUBMISSION.mdpyproject.toml/uv.lock— dependency management viauv; formatting viablack+isortrequirements.md(a fuller, production-style spec I drafted separately) is kept in the repo as reference but was deliberately not thedriving spec for this submission — see
AI_USE.mdfor why.Test plan
uv syncinstalls cleanly from a clean checkoutuv run harness.py --repeat 3runs all 18 conversations 3x with no crashes or unhandled API errorsuv run solution/eval.pyreports 339/339 policy checks passed, 100% helpfulness, 15/18 conversations action-stablesafety/ingestion) against
policy/cs-guide.md