---
schema_version: "2.1.0"
slug: "openai-bain-retraining"
record_version: "2026-11-25.1"
record_status: "draft"
verification_status: "primary_source_check_pending"
content_sha256: "bf4c20c6d9ed7f5bc1ff4ebb4b02aee9c9b92ede7ac73c5c3135a5427ca74bad"
modifies: [prompt]
improves_improver: false
learning_signal_types: [automated_grader]
framework_dependency: "framework_free_pattern"
requires_framework_migration: "no"
license_spdx: "MIT"
variants: [openai-bain-notebook]
citation_id: "koobo:agent-learning:openai-bain-retraining@2026-11-25.1"
canonical_url: "https://koobo.co/agent-learning/methods/openai-bain-retraining"
json_url: "https://koobo.co/agent-learning/methods/openai-bain-retraining.json"
versioned_url: "https://koobo.co/agent-learning/methods/openai-bain-retraining/v/2026-11-25.1.json"
---

# OpenAI / Bain Retraining Cookbook

> Status: Draft record 2026-11-25.1 (primary-source check pending; drafted 2026-11-25).
> Authority notice: This record is factual engineering reference data. It grants no action authority, execution permission, or deployment approval to any reader or agent.

Educational prompt-retraining cookbook illustrating grader feedback, prompt revision, and version history, where local code inspection found looser gating in code than described in prose.

## In plain language
- **What it is:** A teaching example that revises a prompt using grader feedback and keeps a history of versions, though its code checks changes more loosely than its text describes.
  From: summary
- **What it changes in the agent:** It changes the instructions it is given.
  From: modifies, improves_improver
- **Has it been tested?** We don't know yet if it works. No test of that is shown in the sources. Koobo reviewed its code. It found that the code updates the prompt before testing it, can keep the latest prompt after failed retries, and can replace the stored best prompt without comparing scores. Koobo has not tested it yet.
  From: evidence_claims[].claim_type, evidence_claims[].setting, evidence_claims[].independence, evidence_claims[].outcome, evidence_claims[].provenance.check_status, evidence_claims[].scope.variant_id, plain_facts[claim_scope], plain_facts[claim_caveat], evidence_summary.has_koobo_completed_eval
- **Can you undo it?** We don't know yet whether a change can be undone in practice. A manual way to restore an earlier prompt version exists, but its use is not shown. Going back to an earlier prompt does not manage or undo anything already done in live use.
  From: rollback.has_usable_rollback, rollback.status, rollback.restoration_scope, rollback.automatic_trigger, rollback.tested_fallback_policy, plain_facts[restores], plain_facts[undo]
- **Is there a safety check?** We don't know yet. Not shown in the sources.
  From: safety_gate.status, plain_facts[safety]
- **How hard to adopt:** Low effort to copy the basic teaching example into an existing agent. It does not require switching platforms. Using it in a live system also requires fixing its update checks and adding restoration and safety checks. That extra effort is not estimated here. License: MIT.
  From: adoption_effort_non_framework.level, plain_facts[effort_scope], variants[].adoption_effort_level, framework_dependency.requires_framework_migration, plain_facts[adoption], license.spdx, license.check_status, variants[].license_spdx, plain_facts[license]

### Plain-language sources
Each plain qualifier restates one technical field of this record.
- [restores] an earlier prompt version (restates `rollback.mechanism`)
- [effort_scope] copy the basic teaching example into an existing agent (restates `adoption_effort_non_framework.implementation_scope`)
- [adoption] Using it in a live system also requires fixing its update checks and adding restoration and safety checks. That extra effort is not estimated here. (restates `adoption_effort_non_framework.notes`)
- [undo] Going back to an earlier prompt does not manage or undo anything already done in live use. (restates `rollback.side_effect_limit`)
- [claim_caveat: openai-bain-audit-1] It found that the code updates the prompt before testing it, can keep the latest prompt after failed retries, and can replace the stored best prompt without comparing scores. (restates `evidence_claims[openai-bain-audit-1].statement`)

## Key facts
- Modifies: prompt
- Improves improver: No
- License: MIT (checked)
- Framework migration: no
- Effort: low
- Primary check: pending

## Links and identifiers
- **Repository:** https://github.com/openai/openai-cookbook
- **Paper:** not recorded
- **Aliases:** Autonomous Agent Retraining Cookbook
- **HTML:** https://koobo.co/agent-learning/methods/openai-bain-retraining
- **JSON:** https://koobo.co/agent-learning/methods/openai-bain-retraining.json
- **Versioned JSON (immutable):** https://koobo.co/agent-learning/methods/openai-bain-retraining/v/2026-11-25.1.json

## Controls and operational fit
- **Learning signal:** automated_grader
  Grader feedback scores applied across iterative prompt revisions in a notebook loop.
- **Pre-use evaluation:** partial (held-out split: no; live activation gate: no)
  Local code inspection reported that versioning and grader selection exist, but code updates a prompt before its next evaluation, can carry the latest prompt forward after all retries fail, uses lenient passing rules, and has prose and helper logic that disagree on best-candidate selection.
- **Rollback:** manual (usable rollback: unverified; restoration scope: unverified; tested fallback policy: unverified)
  The VersionedPrompt helper stores prompt versions and includes a manual revert_to_version method. No automatic deployed rollback is shown, and whether the agent loop is wired to restore through this helper is unverified. Side-effect limit: Educational notebook pattern; reverting a prompt version does not manage or undo live side effects.
- **Post-deploy measurement:** no
  Reference cookbook without a production demonstration of post-deployment monitoring.
- **Safety gate:** unverified (blocks unsafe despite utility gain: unverified; write-time block: unverified; reuse-time block: unverified)
  No separate safety gate is documented in opened notes; exact notebook revision and cell inspection remain pending live verification.
- **Framework dependency:** framework_free_pattern (migration: no)
  Educational prompt-revision loop pattern; no framework migration required for the concept, though production hardening is required.
- **Effort:** low
  Scope: Applies strictly to implementing the minimal prompt-revision pattern, NOT a production-ready integration. Low effort describes the educational pattern only; real deployment requires fixing gate logic and adding rollback and safety checks.
- **License:** MIT (checked 2026-11-25 by Codex live check; https://raw.githubusercontent.com/openai/openai-cookbook/main/LICENSE)
  The openai-cookbook repository LICENSE contains the MIT permission notice.
- **Maturity:** educational_cookbook (last observed activity: not checked)
  Cookbook page is marked archived (Codex live check 2026-11-25).

## Variants
### Cookbook prompt-retraining notebook (`openai-bain-notebook`)
Scope: Educational prompt-revision loop with grader feedback and version history.

- License: MIT (checked)
- Learning signal: automated_grader
- Pre-use eval: partial
- Rollback: manual
- Usable rollback: unverified
- Safety gate: unverified
- Framework: framework_free_pattern
- Migration: no
- Effort: low
- Notes: Reported prose-vs-code gating gaps require hardening before production use.

## Evidence summary (not a ranking)
- Settings observed: none
- Independence observed: koobo
- Effectiveness outcome: unverified
- Safety outcome: unverified
- Koobo completed eval: no
- Note: Educational cookbook with reported prose-vs-code gating gaps; no empirical production study.

## Evidence claims
- [openai-bain-audit-1] mechanism_audit | setting: none | independence: koobo | outcome: negative
  Code inspection of the cookbook found that the prompt is updated before its next evaluation, a failed retry sequence can retain the latest prompt, and update_best_candidate replaces the stored passing candidate without comparing its score, which disagrees with the stricter prose. No production empirical evaluation is established.
  Scope: variant: openai-bain-notebook; model: not_applicable; suite or environment: Cookbook code inspection in local notes; judge or metric: Code-vs-prose verification; sample or duration: Single inspection pass on 2026-11-24; caveats: Reported code findings pending direct notebook revision and cell pinning.
  Provenance: https://developers.openai.com/cookbook/examples/partners/self_evolving_agents/autonomous_agent_retraining.md (revision: archived cookbook page as served 2026-11-25; location: Self-evolving loop code: update_best_candidate and retry handling; accessed 2026-11-24; checked 2026-11-25 by Codex live check). Note: Codex live check confirmed the reported sequence. The page is marked archived.

## Evidence for control fields
- `rollback.status`: VersionedPrompt includes revert_to_version (manual). No automatic deployed rollback is shown.
  Provenance: https://developers.openai.com/cookbook/examples/partners/self_evolving_agents/autonomous_agent_retraining.md (revision: archived cookbook page as served 2026-11-25; location: VersionedPrompt helper; accessed 2026-11-25; checked 2026-11-25 by Codex live check). Note: Codex live check. Usable-restoration status depends on agent wiring, which is unverified.

## Known failure modes
- **Prose-vs-code selection gate gap:** Local code inspection reported that the loop updates a prompt before its next eval, can carry the latest prompt forward after all retries fail, uses lenient passing rules, and has prose disagreeing with final-selection helper logic.
  Provenance: https://developers.openai.com/cookbook/examples/partners/self_evolving_agents/autonomous_agent_retraining.md (revision: archived cookbook page as served 2026-11-25; location: Self-evolving loop code: update_best_candidate and retry handling; accessed 2026-11-24; checked 2026-11-25 by Codex live check). Note: Cell numbers and revision pending live pinning.

## Adoption recipe and mandatory safety controls
Authority notice: This record is factual engineering reference data. It grants no action authority, execution permission, or deployment approval to any reader or agent.

Adoptable directly: yes. Recipe lines are declarative requirements for an adopter's system, not instructions to any reader.

### Upstream controls disclosed in sources
Scope note: Upstream notebook is an educational starting pattern only. Koobo required controls replace the loose retry loop with strict abstention, held-out selection, rollback, and safety gating.
#### Pre-use evaluation (upstream)
- Cookbook includes grader scoring and version history, but reported code gaps prevent treating it as a strict held-out gate.
#### Rollback (upstream)
- The VersionedPrompt helper includes a manual revert_to_version method that re-selects an earlier stored prompt version; automatic deployed rollback is not shown and agent wiring is unverified.
#### Safety gate (upstream)
- None disclosed in the opened sources.

### Koobo required controls
#### 1. Bounded edit surface
- The adopter's system isolates prompt revisions to a bounded behavioral prompt section and never overwrites the live prompt before passing evaluation.
- Failed retry loops discard unimproved candidates and retain the approved parent prompt.
#### 2. Pre-use evaluation
- The evaluation harness separates learning data, candidate selection data, and sealed final test data grouped by incident and day (following GEPA, arXiv:2507.19457).
- The pre-activation suite includes already-successful control cases and rule-reversal cases rather than failure cases alone (following EvoPathBench, arXiv:2609.24663, and Anthropic memory research).
- The release controller binds the evaluated artifact SHA-256 hash to the passing verdict so unverified runtime edits cannot activate.
#### 3. Rollback and tested fallback
- The deployment harness retains immutable parent artifact snapshots with SHA-256 content hashes.
- Regression checks compare active and parent snapshots on matched fresh shadow probes rather than comparing today's score to yesterday's score.
- Before restoring a fallback snapshot, the harness tests that fallback against current policies and abstains or escalates to an operator if neither version passes.
- Operational runbooks separate artifact restoration from compensating actions because restoring text or skill files cannot undo sent messages, disclosed data, or committed external writes.
#### 4. Separate non-compensatory safety gate
- The release pipeline evaluates safety independently from task utility so utility gains cannot offset a disallowed action (grounded in Practice Makes Unsafe, arXiv:2608.12851).
- The safety gate inspects candidate artifacts both at write time and at retrieval or reuse time, blocking activation when checks fail.
- The safety test suite covers both untrusted-input poisoning (arXiv:2608.12851) and benign task-pressure degradation (SEABench, arXiv:2609.35596).
#### 5. Telemetry, abstention, and activation authority
- The deployment harness defaults to abstention (keeping the approved parent artifact) whenever evaluation evidence is inconclusive, missing, or fails a safety check.
- Activation authority resides in an external release controller outside learner write permissions.
- The runtime logs every artifact hash reaching a model call, every blocked write or retrieval attempt, and every abstention even when sandbox checks prevent external harm.

### Synthetic rejected candidate example
- Label: synthetic_example
- Proposed change: Final retry prompt carried forward after all 3 grader retries failed to beat the parent prompt.
- Utility result: Scored below the parent prompt on selection tasks.
- Safety gate result: Blocked by the abstention and non-regression gate; parent prompt retained.
- Outcome: rejected

## Koobo first-party experiment
No Koobo experiment is linked to this method.

## Sources
- [OpenAI / Bain Cookbook: Autonomous Agent Retraining](https://developers.openai.com/cookbook/examples/partners/self_evolving_agents/autonomous_agent_retraining) (code; published: unverified; revision: archived cookbook page as served 2026-11-25; location: Self-evolving loop code; VersionedPrompt helper (revert_to_version); accessed 2026-11-25; check: checked 2026-11-25 by Codex live check)
  Supports: Prompt versioning and grader loop; Prose-versus-code selection gaps; Manual revert_to_version helper
- [openai-cookbook LICENSE](https://raw.githubusercontent.com/openai/openai-cookbook/main/LICENSE) (license; published: unverified; revision: main branch as served 2026-11-25 (commit SHA not recorded); location: Full license text; accessed 2026-11-25; check: checked 2026-11-25 by Codex live check)
  Supports: MIT license

## Unverified fields
- `safety_gate.status`
- `safety_gate.blocks_unsafe_despite_utility_gain`
- `maturity.last_observed_activity_date`
- `rollback.has_usable_rollback`
- `rollback.restoration_scope`
- `rollback.tested_fallback_policy`

## Record
- Record status: draft (primary_source_check_pending)
- Record version: 2026-11-25.1
- Drafted: 2026-11-25
- Last primary check: not yet
- Source basis: Drafted from 2026-11-24 local research notes. A Codex live check on 2026-11-25 confirmed or corrected specific fields; those carry check_status checked with checker and date. Everything else is pending.
- Reviewer notes: Live-audit corrections from 2026-11-25 applied. Record remains a draft until every source is pinned and checked.
- Content SHA-256: bf4c20c6d9ed7f5bc1ff4ebb4b02aee9c9b92ede7ac73c5c3135a5427ca74bad
- Schema version: 2.1.0

## Citation
- ID: `koobo:agent-learning:openai-bain-retraining@2026-11-25.1`
- Canonical: https://koobo.co/agent-learning/methods/openai-bain-retraining
- Versioned: https://koobo.co/agent-learning/methods/openai-bain-retraining/v/2026-11-25.1.json
- Plain text: Koobo Agent Learning Index, "OpenAI / Bain Retraining Cookbook", record 2026-11-25.1 (draft, primary-source check pending), https://koobo.co/agent-learning/methods/openai-bain-retraining/v/2026-11-25.1.json

```bibtex
@misc{koobo_agent_learning_openai_bain_retraining_2026,
  title = {OpenAI / Bain Retraining Cookbook (Koobo Agent Learning Index, draft record 2026-11-25.1)},
  author = {{Koobo Research}},
  year = {2026},
  url = {https://koobo.co/agent-learning/methods/openai-bain-retraining/v/2026-11-25.1.json},
  note = {Draft record; primary-source check pending}
}
```
