← Back to learning path
Case · Published

Case study: a deployment-advice agent with human approval

Let an agent prepare a release checklist while requiring a person to approve every production change.

Source: knowledge/p24-b/collection_8023a8d754046b6c2ae7220f/cases/agent-release-gate-with-human-approval.mdAI agent engineering
Chapter progress 0%Learning path progress 0% · 0/10 chapters completedContinue learning path →

Problem and boundaries

The team wants to automate the collection of pre-release checks. The agent may read configuration and test results, but it must not deploy, change permissions, or expose secrets.

Design

Separate reading, analysis, and recommendation into three stages. The recommendation contains evidence links, risk levels, and open questions. It enters an approval record instead of calling a deployment API.

Minimal implementation

def release_advice(checks: list[dict]) -> dict:
    missing = [item['name'] for item in checks if not item.get('passed')]
    return {
        'status': 'needs_review' if missing else 'ready_for_review',
        'missing': missing,
        'action': 'human_approval_required',
    }

assert release_advice([{'name': 'rollback', 'passed': False}])['status'] == 'needs_review'

Reproduction steps

  1. Provide build results, type checks, dependency scans, and rollback evidence as read-only inputs.
  2. Generate a recommendation with evidence ids; never send environment-variable values to the model.
  3. Write the recommendation to an approval record and use a one-time approval token.
  4. After approval, let the existing release system execute. The agent never receives deployment credentials.

Verification checklist

Check missing rollback evidence, duplicate recommendations, expired approvals, insufficient permissions, and unknown fields returned by the model.

Common questions

Can approval trigger deployment automatically? The existing release system may do so under its own permissions, but this case does not let the agent call it directly.

Is it safe for the model to see logs? Provide only redacted summaries and links; filter sensitive values on the server.

Official references

OpenAI Production best practices; OpenAI Safety best practices.

Last checked: 2026-11-16. Follow the linked sources for current interfaces and security boundaries; this case makes no performance or cost claim.

Prerequisite tutorials

KnowledgeAgent observability and cost controlsKnowledgeAgent production release: canary, rollback, and human handoff

Further reading

KnowledgeDesigning Reliable AI Automation WorkflowsKnowledgeAI Agents: From Core Concepts to ProductionKnowledgeRAG for Enterprise Knowledge: Architecture and Practice
Product Hub Demo · V0.3