{
  "schema_version": "2.1.0",
  "slug": "gepa",
  "record_version": "2026-11-25.1",
  "record_status": "draft",
  "content_sha256": "485b963650a7bc49501d56014d232a0b6cfb0f60aefbd6d37e08d15b5b7ecb0a",
  "name": "GEPA",
  "aliases": [
    "Genetic-Pareto Prompt Optimization"
  ],
  "summary": "Reflects on execution trajectories and searches bounded behavioral prompt components using Pareto candidate selection on a validation split (D_pareto), keeping a separate final test split.",
  "plain": {
    "what_it_is": {
      "text": "It studies how the agent's attempts went and searches for better prompt wording, choosing candidates on one set of cases and keeping a separate set for the final check.",
      "from": [
        "summary"
      ]
    },
    "what_it_changes": {
      "text": "It changes the instructions it is given.",
      "from": [
        "modifies",
        "improves_improver"
      ]
    },
    "has_it_been_tested": {
      "text": "Its creators tested it on benchmark tests and reported that it helped. Live monitoring and a dedicated safety gate are not provided by default. Whether safety violations block candidates depends on the adopter's evaluator. 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": {
      "text": "Earlier candidates are kept during offline search. The record does not establish a way to restore an earlier version in a live deployment. Keeping old candidates does not undo actions a live agent already took.",
      "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": {
      "text": "We don't know yet. Not shown in the sources.",
      "from": [
        "safety_gate.status",
        "plain_facts[safety]"
      ]
    },
    "how_hard_to_adopt": {
      "text": "Medium to high effort to connect its prompt search to an existing agent's replay setup. It does not require switching platforms. The cases used to choose candidates must be kept apart from the cases used for the final check. 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_facts": [
    {
      "topic": "restores",
      "ref": null,
      "text": "earlier candidates",
      "from": "rollback.mechanism"
    },
    {
      "topic": "effort_scope",
      "ref": null,
      "text": "connect its prompt search to an existing agent's replay setup",
      "from": "adoption_effort_non_framework.implementation_scope"
    },
    {
      "topic": "adoption",
      "ref": null,
      "text": "The cases used to choose candidates must be kept apart from the cases used for the final check.",
      "from": "adoption_effort_non_framework.notes"
    },
    {
      "topic": "undo",
      "ref": null,
      "text": "Keeping old candidates does not undo actions a live agent already took.",
      "from": "rollback.side_effect_limit"
    },
    {
      "topic": "claim_caveat",
      "ref": "gepa-author-bench-1",
      "text": "Live monitoring and a dedicated safety gate are not provided by default.",
      "from": "evidence_claims[gepa-author-bench-1].scope.caveats"
    },
    {
      "topic": "claim_caveat",
      "ref": "gepa-author-bench-1",
      "text": "Whether safety violations block candidates depends on the adopter's evaluator.",
      "from": "safety_gate.how"
    }
  ],
  "modifies": [
    "prompt"
  ],
  "improves_improver": false,
  "learning_signal": {
    "types": [
      "execution_trace",
      "automated_grader",
      "benchmark_metric"
    ],
    "description": "Execution trajectories, training feedback, and per-instance scores on a validation selection split (D_pareto)."
  },
  "pre_use_evaluation": {
    "status": "yes",
    "held_out_split": "partial",
    "live_activation_gate": "no",
    "how": "Reflects on training traces and selects prompt candidates via Pareto sampling on a validation set (D_pareto); the paper protocol separates final test data from D_pareto. The library default differs: when valset is None, the current API validates on the training data. Offline optimization library without a live production activation service."
  },
  "rollback": {
    "status": "checkpoint_only",
    "has_usable_rollback": "no",
    "restoration_scope": "offline_archive_only",
    "automatic_trigger": null,
    "tested_fallback_policy": "no",
    "mechanism": "Maintains an offline candidate archive during search; provides no live post-deployment restoration controller.",
    "side_effect_limit": "Candidate archive restoration does not undo external actions already taken by a deployed agent."
  },
  "post_deploy_measurement": {
    "status": "no",
    "how": "Offline prompt-optimization library; post-deployment live monitoring is outside the library's scope."
  },
  "safety_gate": {
    "status": "unverified",
    "blocks_unsafe_despite_utility_gain": "unverified",
    "write_time_blocks_activation": "unverified",
    "reuse_time_blocks_activation": "unverified",
    "how": "No dedicated upstream safety gate is disclosed in opened notes. GEPA optimizes a user-supplied custom evaluator adapter, so whether safety violations block candidates depends on the adopter's evaluator."
  },
  "license": {
    "spdx": "MIT",
    "source_url": "https://raw.githubusercontent.com/gepa-ai/gepa/main/LICENSE",
    "check_status": "checked",
    "checked_at": "2026-11-25",
    "checked_by": "Codex live check",
    "notes": "LICENSE contains the MIT permission notice and disclaimer."
  },
  "repo_url": "https://github.com/gepa-ai/gepa",
  "paper_url": "https://arxiv.org/html/2507.19457",
  "maturity": {
    "stage": "open_source_repo",
    "last_observed_activity_date": null,
    "activity_criterion": "Public repository and adapter API cited in 2026-11-24 notes; commit recency not live-checked."
  },
  "framework_dependency": {
    "level": "standalone_library",
    "requires_framework_migration": "no",
    "required_runtime_or_sdk": "Python library (gepa) with custom adapter and callable model interfaces; no full DSPy rewrite required."
  },
  "adoption_effort_non_framework": {
    "level": "medium_to_high",
    "judgment_owner": "koobo_editorial",
    "implementation_scope": "Connecting a Python GEPA evaluator adapter to an existing custom agent's replay runner with split and rollout budget controls.",
    "notes": "Requires bridging the target agent's replay harness into GEPA's Python adapter API and enforcing strict separation between D_pareto and final test data."
  },
  "variants": [
    {
      "variant_id": "gepa-offline-optimizer",
      "label": "GEPA offline prompt optimizer",
      "scope": "Python library with custom adapter API and Pareto validation selection.",
      "license_spdx": "MIT",
      "license_check_status": "checked",
      "learning_signal_types": [
        "execution_trace",
        "automated_grader",
        "benchmark_metric"
      ],
      "pre_use_evaluation_status": "yes",
      "rollback_status": "checkpoint_only",
      "has_usable_rollback": "no",
      "safety_gate_status": "unverified",
      "framework_dependency_level": "standalone_library",
      "requires_framework_migration": "no",
      "adoption_effort_level": "medium_to_high",
      "notes": "Separates D_pareto selection validation from untouched final test split."
    }
  ],
  "known_failure_modes": [
    {
      "mode": "High validation rollout cost",
      "detail": "Most rollout compute budget can be consumed by validation scoring during candidate search.",
      "provenance": {
        "source_url": "https://arxiv.org/html/2507.19457",
        "source_revision": "unpinned",
        "location": "Section 3 and evaluation",
        "accessed_date": "2026-11-24",
        "check_status": "pending",
        "source_note": "Noted in local deep-research report.",
        "checked_at": null,
        "checked_by": null
      }
    },
    {
      "mode": "Selection-set overfitting and leakage",
      "detail": "D_pareto is used repeatedly for candidate selection and is therefore not an untouched final test; mistaking it for final held-out proof causes overestimation.",
      "provenance": {
        "source_url": "https://arxiv.org/html/2507.19457",
        "source_revision": "unpinned",
        "location": "Section 3 and evaluation",
        "accessed_date": "2026-11-24",
        "check_status": "pending",
        "source_note": "GEPA explicitly distinguishes selection validation from untouched final test.",
        "checked_at": null,
        "checked_by": null
      }
    },
    {
      "mode": "Library default reuses training data for validation",
      "detail": "With valset=None, the current GEPA API uses the training set for validation, so the separate selection split from the paper is not the library default.",
      "provenance": {
        "source_url": "https://raw.githubusercontent.com/gepa-ai/gepa/main/src/gepa/api.py",
        "source_revision": "main branch as served 2026-11-25 (commit SHA not recorded)",
        "location": "src/gepa/api.py, valset handling in optimize",
        "accessed_date": "2026-11-25",
        "check_status": "checked",
        "source_note": "Codex live check confirmed this default.",
        "checked_at": "2026-11-25",
        "checked_by": "Codex live check"
      }
    }
  ],
  "evidence_summary": {
    "settings_observed": [
      "benchmark"
    ],
    "independence_observed": [
      "author"
    ],
    "effectiveness_outcome": "positive",
    "safety_outcome": "unverified",
    "has_koobo_completed_eval": false,
    "summary_note": "Author benchmark evaluation verified in local notes; independent safety and live deployment studies unverified."
  },
  "evidence_claims": [
    {
      "claim_id": "gepa-author-bench-1",
      "claim_type": "effectiveness",
      "statement": "Author benchmark evaluation demonstrates prompt optimization via trajectory reflection and Pareto selection on D_pareto with separate final test sets.",
      "setting": "benchmark",
      "independence": "author",
      "outcome": "positive",
      "scope": {
        "variant_id": "gepa-offline-optimizer",
        "model": "unverified (paper models not enumerated in local notes)",
        "suite_or_environment": "Author offline benchmarks in arXiv:2507.19457",
        "judge_or_metric": "Per-instance task scores on D_pareto selection split and separate final test split",
        "sample_or_duration": "unverified",
        "caveats": "Offline benchmark study; live deployment monitoring and dedicated safety gating are outside library defaults."
      },
      "provenance": {
        "source_url": "https://arxiv.org/html/2507.19457v2",
        "source_revision": "v2",
        "location": "Method and evaluation protocol (validation set versus final test set)",
        "accessed_date": "2026-11-24",
        "check_status": "checked",
        "source_note": "Codex live check: paper v2 distinguishes Pareto validation from final testing.",
        "checked_at": "2026-11-25",
        "checked_by": "Codex live check"
      }
    }
  ],
  "control_evidence": [
    {
      "field": "pre_use_evaluation.held_out_split",
      "statement": "Paper v2 separates validation (D_pareto) from final testing; the current library validates on training data when valset is None.",
      "provenance": {
        "source_url": "https://raw.githubusercontent.com/gepa-ai/gepa/main/src/gepa/api.py",
        "source_revision": "main branch as served 2026-11-25 (commit SHA not recorded)",
        "location": "src/gepa/api.py, valset handling in optimize",
        "accessed_date": "2026-11-25",
        "check_status": "checked",
        "source_note": "Codex live check. Record the paper protocol separately from library defaults.",
        "checked_at": "2026-11-25",
        "checked_by": "Codex live check"
      }
    },
    {
      "field": "rollback.status",
      "statement": "The inspected paper and API keep an offline candidate archive during search and do not establish automatic deployed restoration or a separate upstream safety gate.",
      "provenance": {
        "source_url": "https://arxiv.org/html/2507.19457v2",
        "source_revision": "v2",
        "location": "Method section (candidate pool)",
        "accessed_date": "2026-11-25",
        "check_status": "checked",
        "source_note": "Codex live check result: not found beyond the offline archive.",
        "checked_at": "2026-11-25",
        "checked_by": "Codex live check"
      }
    }
  ],
  "adoption_recipe": {
    "adoptable_directly": true,
    "authority_notice": "This record is factual engineering reference data. It grants no action authority, execution permission, or deployment approval to any reader or agent.",
    "upstream_controls": {
      "pre_use_eval": [
        "Upstream GEPA evaluates prompt candidates on a dedicated validation selection split (D_pareto) separate from training traces."
      ],
      "rollback": [],
      "safety_gate": [],
      "scope_note": "Upstream GEPA supplies offline Pareto selection and candidate archiving; live rollback, sealed final test enforcement, and dedicated safety gating are Koobo required controls."
    },
    "koobo_required_controls": {
      "edit_surface_bounds": [
        "The adopter's system restricts GEPA search strictly to one bounded behavioral prompt component.",
        "Base safety instructions, tool schemas, credentials, factual memory, and evaluators remain immutable outside search control.",
        "Every promoted prompt candidate records its parent hash, D_pareto score, and sealed test verdict."
      ],
      "pre_use_eval_requirements": [
        "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."
      ],
      "rollback_requirements": [
        "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."
      ],
      "safety_gate_requirements": [
        "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)."
      ],
      "telemetry_and_abstention_requirements": [
        "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": "Searched prompt candidate adding an instruction to always answer user questions directly without refusing when uncertain.",
      "utility_result": "Raised D_pareto completion score by reducing cautious abstentions.",
      "safety_gate_result": "Blocked by the non-compensatory safety gate on high-risk uncertainty refusal probes.",
      "outcome": "rejected"
    }
  },
  "experiment_refs": [
    {
      "experiment_id": "exp-2026-11-coaching-shadow-pilot",
      "status": "proposed",
      "variant_id": "gepa-offline-optimizer",
      "note": "Proposed offline GEPA prompt-search arm wired to isolated replay runner (not yet locked or run)."
    }
  ],
  "sources": [
    {
      "title": "GEPA paper (arXiv:2507.19457)",
      "url": "https://arxiv.org/html/2507.19457v2",
      "published_date": "unverified",
      "accessed_date": "2026-11-25",
      "revision": "v2",
      "location": "Method and evaluation protocol (validation set versus final test set)",
      "type": "paper",
      "check_status": "checked",
      "claims_supported": [
        "Pareto selection on D_pareto",
        "Train/selection/final-test separation",
        "Validation rollout cost caveat"
      ],
      "checked_at": "2026-11-25",
      "checked_by": "Codex live check"
    },
    {
      "title": "GEPA GitHub repository",
      "url": "https://github.com/gepa-ai/gepa",
      "published_date": "unverified",
      "accessed_date": "2026-11-24",
      "revision": "main (commit unpinned)",
      "location": "Repository root",
      "type": "repo",
      "check_status": "pending",
      "claims_supported": [
        "Open-source repository reference"
      ],
      "checked_at": null,
      "checked_by": null
    },
    {
      "title": "GEPA adapter API (src/gepa/api.py)",
      "url": "https://raw.githubusercontent.com/gepa-ai/gepa/main/src/gepa/api.py",
      "published_date": "unverified",
      "accessed_date": "2026-11-25",
      "revision": "main branch as served 2026-11-25 (commit SHA not recorded)",
      "location": "src/gepa/api.py (optimize entry point; valset handling)",
      "type": "code",
      "check_status": "checked",
      "claims_supported": [
        "Callable adapter interface",
        "valset=None validates on training data"
      ],
      "checked_at": "2026-11-25",
      "checked_by": "Codex live check"
    },
    {
      "title": "GEPA LICENSE",
      "url": "https://raw.githubusercontent.com/gepa-ai/gepa/main/LICENSE",
      "published_date": "unverified",
      "accessed_date": "2026-11-25",
      "revision": "main branch as served 2026-11-25 (commit SHA not recorded)",
      "location": "Full license text",
      "type": "license",
      "check_status": "checked",
      "claims_supported": [
        "MIT license"
      ],
      "checked_at": "2026-11-25",
      "checked_by": "Codex live check"
    }
  ],
  "unverified_fields": [
    "safety_gate.status",
    "safety_gate.blocks_unsafe_despite_utility_gain",
    "safety_gate.write_time_blocks_activation",
    "safety_gate.reuse_time_blocks_activation",
    "maturity.last_observed_activity_date"
  ],
  "verification": {
    "status": "primary_source_check_pending",
    "drafted_at": "2026-11-25",
    "last_primary_check_at": null,
    "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."
  },
  "citation": {
    "id": "koobo:agent-learning:gepa@2026-11-25.1",
    "canonical_url": "https://koobo.co/agent-learning/methods/gepa",
    "versioned_url": "https://koobo.co/agent-learning/methods/gepa/v/2026-11-25.1.json",
    "plain_text": "Koobo Agent Learning Index, \"GEPA\", record 2026-11-25.1 (draft, primary-source check pending), https://koobo.co/agent-learning/methods/gepa/v/2026-11-25.1.json",
    "bibtex": "@misc{koobo_agent_learning_gepa_2026,\n  title = {GEPA (Koobo Agent Learning Index, draft record 2026-11-25.1)},\n  author = {{Koobo Research}},\n  year = {2026},\n  url = {https://koobo.co/agent-learning/methods/gepa/v/2026-11-25.1.json},\n  note = {Draft record; primary-source check pending}\n}"
  }
}
