This prompt is the final gate in an agent's execution lifecycle. It is designed for a single, high-stakes job: forcing a structured, auditable decision when an agent has exhausted every configured recovery path, retry strategy, and fallback for a given objective and still cannot complete it. The ideal user is an AI/ML engineer or technical operator building a supervised autonomy system—such as a coding agent, a multi-step data pipeline, or a customer support automation—where silent failure or infinite loops are unacceptable. The required context is a complete execution trace, the original objective, a list of exhausted recovery attempts, and any partial artifacts generated so far. Without this context, the prompt cannot produce a reliable abandonment recommendation.
Prompt
Goal Abandonment Decision Prompt

When to Use This Prompt
Defines the precise operational boundary for the Goal Abandonment Decision Prompt, distinguishing terminal failure from transient errors.
Use this prompt when the agent's runtime has already tried and failed to self-correct. This means the system has already executed retry recovery prompts, tool call error handling, and dynamic replanning steps. The trigger is not a single failed API call or a malformed JSON output; it is the moment when the agent's orchestrator determines that all programmed resilience strategies have returned unsuccessful results for the same objective. At this point, the prompt evaluates three concrete paths: formally abandon the goal with a structured rationale, produce a partial deliverable from successfully completed sub-tasks, or escalate for human re-scoping with a clear explanation of what is blocked and why. The output must be machine-readable to trigger downstream workflows, such as moving a ticket to a human queue or archiving a project state.
Do not use this prompt for transient errors, steps that can be retried, or situations where a simple replanning prompt would suffice. If the agent can still attempt a different tool, re-prompt the user for clarification, or wait for an external condition, it has not yet reached the abandonment decision point. Premature use of this prompt will lead to unnecessary escalations and abandoned work that could have been recovered. The key operational check before invoking this prompt is: 'Have all configured recovery paths been attempted and logged for this specific objective?' If the answer is no, route the failure back to the appropriate recovery handler. If the answer is yes, this prompt is the correct next step to ensure a clean, auditable termination of the effort.
Use Case Fit
Where the Goal Abandonment Decision Prompt works, where it fails, and the operational preconditions required before deploying it in a production agent loop.
Good Fit: Exhausted Recovery Paths
Use when: The agent has attempted all configured retry strategies, fallback tools, and alternative approaches defined in its error-handling policy. Guardrail: Require a structured retry log as input so the prompt evaluates evidence of exhaustion rather than making an uninformed decision.
Bad Fit: First-Failure Abandonment
Avoid when: A single tool call failure or unexpected output triggers the prompt without any recovery attempt. Guardrail: Gate invocation behind a retry counter or recovery-step checklist. The prompt should only fire after the agent's error-handling state machine reaches a terminal retry-exhausted state.
Required Input: Structured Attempt History
What to watch: The prompt produces generic or incorrect recommendations when given only a natural-language summary of failures. Guardrail: Provide a machine-readable attempt log including step IDs, tool names, error codes, retry counts, and timestamps. Validate input schema before invoking the prompt.
Required Input: Original Goal and Constraints
What to watch: Abandonment decisions drift from user intent when the original goal specification is summarized or truncated. Guardrail: Pass the full, unmodified goal definition and constraint set as input. Never rely on the agent's memory of the goal; retrieve it from the plan store.
Operational Risk: Silent Goal Drift
What to watch: The prompt recommends partial delivery that subtly changes the goal's success criteria without operator awareness. Guardrail: Require the output to include a diff between the original acceptance criteria and what the partial deliverable actually satisfies. Flag any unacknowledged gaps for human review.
Operational Risk: Premature Artifact Discard
What to watch: The prompt recommends abandonment without preserving intermediate work products that could be valuable for manual completion or post-mortem analysis. Guardrail: Include artifact preservation instructions as a required output field. Validate that every completed step with a non-null output has a corresponding preservation entry before accepting the recommendation.
Copy-Ready Prompt Template
A ready-to-adapt prompt for evaluating whether an agent should abandon a goal, produce a partial deliverable, or escalate for re-scoping after exhausting all recovery paths.
The following prompt template is designed to be pasted directly into your agent's decision module. It forces structured reasoning about goal abandonment by requiring the model to evaluate recovery history, remaining options, artifact preservation, and stakeholder impact before making a recommendation. Replace every square-bracket placeholder with runtime state before sending this to the model. The template assumes you have already exhausted configured retry paths and are now at a terminal decision point.
textYou are an agent decision module responsible for evaluating whether to abandon a goal that cannot be completed after exhausting all recovery paths. # OBJECTIVE Determine whether the current goal should be formally abandoned, partially delivered, or escalated for re-scoping. Produce a structured recommendation with rationale and artifact preservation instructions. # CURRENT STATE - Goal ID: [GOAL_ID] - Original Objective: [ORIGINAL_OBJECTIVE] - Success Criteria: [SUCCESS_CRITERIA] - Current Step: [CURRENT_STEP_ID] - Total Steps Planned: [TOTAL_STEPS] - Steps Completed: [COMPLETED_STEP_IDS] - Steps Failed: [FAILED_STEP_IDS] - Recovery Attempts Made: [RECOVERY_ATTEMPT_COUNT] - Recovery Strategies Tried: [RECOVERY_STRATEGIES_LIST] - Last Error Message: [LAST_ERROR_MESSAGE] - Elapsed Execution Time: [ELAPSED_TIME] - Token Budget Consumed: [TOKEN_BUDGET_CONSUMED] - Remaining Token Budget: [REMAINING_TOKEN_BUDGET] # AVAILABLE ARTIFACTS [ARTIFACTS_INVENTORY] # CONSTRAINTS - Deadline: [DEADLINE_TIMESTAMP] - Maximum Recovery Attempts: [MAX_RECOVERY_ATTEMPTS] - Risk Level: [RISK_LEVEL] - Authorization Required for Abandonment: [AUTHORIZATION_REQUIRED] - Stakeholders to Notify: [STAKEHOLDER_LIST] # OUTPUT SCHEMA Return a valid JSON object with exactly this structure: { "decision": "ABANDON" | "PARTIAL_DELIVER" | "ESCALATE_FOR_RESCOPE", "confidence": 0.0-1.0, "rationale": "string explaining the decision with reference to recovery history and remaining options", "partial_artifacts_preserved": ["list of artifact IDs to save"], "abandonment_reason_category": "UNRECOVERABLE_ERROR" | "BUDGET_EXHAUSTED" | "DEADLINE_EXCEEDED" | "DEPENDENCY_FAILURE" | "OBJECTIVE_INVALIDATED" | "OTHER", "stakeholder_summary": "one-paragraph summary suitable for operator or stakeholder notification", "recommended_follow_up": "string describing next action: archive, notify, escalate, or re-scope", "lessons_logged": ["list of failure patterns or observations for post-mortem"] } # DECISION RULES 1. Recommend ABANDON only when all recovery paths are exhausted AND no partial deliverable has value. 2. Recommend PARTIAL_DELIVER when completed steps produced usable artifacts even if the full goal is unreachable. 3. Recommend ESCALATE_FOR_RESCOPE when the original objective may still be achievable with modified constraints, additional resources, or human intervention. 4. Never recommend retry. This decision point assumes retries are already exhausted. 5. If authorization is required for abandonment, flag this in the recommended_follow_up field. # EVALUATION CRITERIA - Was the failure caused by an unrecoverable external dependency? - Do completed steps have standalone value? - Would additional budget or time meaningfully change the outcome? - Has the original objective been invalidated by new information? - What is the cost of continued execution versus abandonment?
Adapt this template by adjusting the decision rules to match your organization's abandonment policies. If your agent framework uses different recovery exhaustion signals, replace the recovery-related placeholders with your own state representation. The output schema is deliberately flat to simplify parsing in downstream orchestration code. Add fields if your workflow requires additional metadata such as compliance flags, cost center codes, or audit trail references.
Before deploying this prompt, validate that your runtime state injection correctly populates all placeholders. Missing state causes the model to hallucinate recovery history or skip critical constraints. Test with at least three scenarios: a clear abandonment case, a partial delivery case, and an escalation case. For high-risk domains, route the model's output through a human review step before executing the abandonment action.
Prompt Variables
Inputs the prompt needs to work reliably. Each variable must be populated from the agent's runtime state before invoking this prompt.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[GOAL_SUMMARY] | The original objective the agent was tasked to achieve. | Generate a Q3 financial compliance report for the APAC region. | Must be non-empty string. Check for truncation if sourced from a prior plan step. |
[EXECUTION_HISTORY] | A structured log of all steps attempted, including tool calls, outputs, and errors. | Step 1: query_finance_db(...) -> Error: Connection timeout. Step 2: query_finance_db(...) -> Error: Connection timeout. | Must be a valid JSON array of step objects. Validate schema: each step requires 'step_id', 'action', 'status', 'timestamp'. |
[RECOVERY_PATHS_EXHAUSTED] | An enumerated list of all recovery strategies already attempted and their outcomes. |
| Must be a non-empty list. If empty, the agent should not be invoking the abandonment prompt; check the retry counter first. |
[PARTIAL_ARTIFACTS] | Any incomplete or intermediate outputs generated before the failure. | A partially populated CSV with headers but only 10 of 1000 expected rows. | Can be null. If present, validate MIME type and file size. Do not pass raw binary; use a file pointer or summary. |
[CONSTRAINT_VIOLATIONS] | A list of constraints that are being violated by continuing execution. | Time budget exceeded (est. 45min remaining, step requires 2hrs). Cost budget at 150%. | Must be a list of strings. Each entry should reference a specific constraint from the original plan. Null not allowed; if no violations, pass an empty array. |
[ESCALATION_POLICY] | The configured rules for when to escalate to a human vs. autonomously abandon. | Escalate if cost > $500 or data freshness > 24h. Abandon autonomously if all retries exhausted on non-critical path. | Must be a valid JSON object. Validate against a predefined policy schema. If missing, the prompt must fail closed and escalate. |
[CURRENT_STATE_SNAPSHOT] | A summary of the agent's current working memory, including unresolved variables and assumptions. | Assumption: APAC data schema matches EMEA schema (unverified). Unresolved: region_code for Singapore office. | Must be a non-empty string. Check for a minimum character length to prevent empty summaries from masking state loss. |
Implementation Harness Notes
How to wire the Goal Abandonment Decision Prompt into an agent runtime with validation, retries, and escalation guardrails.
The Goal Abandonment Decision Prompt is not a standalone chat interaction—it is a decision node inside an agent execution loop. It should be invoked only after the agent's recovery and replanning paths have been exhausted. The typical call site is inside an error-handling or fallback strategy module that tracks retry counts, replanning attempts, and tool call failure histories. Before calling this prompt, the harness must assemble a structured context object containing: the original goal specification, a summary of all attempted recovery steps, the current plan state, any partial artifacts produced, and the configured abandonment policy (e.g., maximum retries, cost thresholds, or time budgets). This context becomes the [EXECUTION_TRACE] and [ABANDONMENT_POLICY] inputs to the prompt template.
The harness should enforce a strict invocation gate. Do not call the abandonment prompt on the first failure, or even the first replanning cycle. A counter or state machine should track how many distinct recovery paths have been attempted. For example, if the agent has tried three different tool-based approaches, two replanning iterations, and one human clarification request without progress, the harness increments an exhaustion_counter. Only when exhaustion_counter >= ABANDONMENT_THRESHOLD (a configurable integer, typically 3-5) does the harness invoke this prompt. This prevents premature abandonment and ensures the prompt receives a rich failure history rather than a single error message. Log the counter value, the trigger event, and a hash of the execution trace before calling the model for auditability.
The model's output must pass a structural validator before any downstream action is taken. The expected output schema includes: decision (enum: abandon, partial_deliver, escalate), rationale (string), partial_artifacts (array of artifact IDs and descriptions), preservation_instructions (object with storage paths or handoff notes), and confidence (float 0-1). If the validator rejects the output—due to a missing decision field, an unrecognized enum value, or a partial_deliver decision with an empty partial_artifacts array—retry the prompt once with the validation error appended to the [CONSTRAINTS] input. If the retry also fails validation, default to escalate and log the double-failure for operator review. Never execute an abandonment action without a validated decision object.
For high-stakes workflows—such as financial transactions, clinical documentation, or legal filings—the harness must route escalate and partial_deliver decisions to a human review queue. Even abandon decisions should be logged with the full prompt context and model output for post-hoc audit. The review queue integration should include: the original goal, the exhaustion counter value, the abandonment prompt output, and a one-click option for the reviewer to approve, reject, or modify the decision. If the reviewer rejects the abandonment, the harness should re-invoke the planning module with the reviewer's notes as additional constraints, not simply retry the same failed execution path.
Model choice matters here. This prompt requires strong instruction-following and structured output reliability, not creative reasoning. Use a model with proven JSON mode or structured output support (e.g., GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro with response schema). Set temperature=0 or a very low value (0.1 maximum) to reduce variance in the abandonment decision. If using a model without native structured output, append a strict JSON-only instruction to the [OUTPUT_SCHEMA] block and run a post-generation JSON parser with schema validation. Avoid using this prompt with small or instruction-weak models that are prone to hallucinating recovery paths instead of honestly assessing exhaustion.
Finally, treat the abandonment prompt output as a durable decision record, not a transient event. Write the validated decision, rationale, and artifact preservation instructions to an append-only execution log or audit table. This log becomes the source of truth for post-mortem analysis, cost attribution, and workflow improvement. If the agent later resumes from a checkpoint, the harness should check this log before re-attempting any previously abandoned goal—nothing wastes more tokens than an agent that abandons and then silently restarts the same objective.
Expected Output Contract
Defines the exact fields, types, and validation rules for the Goal Abandonment Decision Prompt response. Use this contract to parse and validate the model output before acting on the abandonment recommendation.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
abandonment_decision | enum: abandon | partial_deliver | escalate_for_rescope | Must match one of the three allowed enum values exactly. Reject any other string. | |
rationale_summary | string (<= 500 chars) | Must be non-empty and contain at least one explicit reference to a recovery path that was attempted and exhausted. Reject if length exceeds 500 characters. | |
original_goal | string | Must match the [GOAL_DESCRIPTION] input exactly or be a verbatim quote from it. Reject if the goal text is hallucinated or altered. | |
recovery_paths_attempted | array of strings | Must contain at least one entry. Each entry must reference a specific tool, action, or strategy from the [RECOVERY_LOG] input. Reject if the array is empty or contains fabricated recovery attempts. | |
partial_artifacts | array of objects | If present, each object must include an artifact_id string and a description string. Null or empty array is allowed only when abandonment_decision is abandon or escalate_for_rescope. | |
artifact_preservation_instructions | string | Must contain actionable storage or export instructions for any partial_artifacts. If no artifacts exist, must explicitly state 'No artifacts to preserve.' Reject if instructions reference non-existent artifacts. | |
escalation_recipient | string or null | Required when abandonment_decision is escalate_for_rescope. Must match a role from the [ESCALATION_ROLES] input or be null. Reject if escalation_recipient is provided for abandon or partial_deliver decisions. | |
confidence_score | number (0.0 - 1.0) | Must be a float between 0.0 and 1.0 inclusive. Reject if out of range. If confidence_score < 0.7, flag for human review regardless of abandonment_decision. |
Common Failure Modes
Goal abandonment is a high-stakes decision that can waste completed work or prematurely terminate a recoverable task. These failure modes surface what breaks first when the prompt is deployed in a production agent loop.
Abandoning Too Early on Transient Errors
What to watch: The model classifies a temporary tool outage or a single malformed API response as an exhausted recovery path and recommends abandonment. Guardrail: Require the prompt to distinguish between transient errors (network, rate-limit, timeout) and permanent failures (auth, schema mismatch, missing resource) before recommending abandonment. Include a minimum retry count and error-type classification step in the prompt logic.
Silent Partial Deliverable Loss
What to watch: The agent abandons the goal and produces a rationale but fails to preserve intermediate artifacts, partial results, or completed subtask outputs. Guardrail: Add an explicit output field for preserved_artifacts with paths, IDs, or summaries. Validate that the field is non-empty when completion_percentage > 0 before accepting the abandonment decision.
Over-Escalation Without Re-Scoping Options
What to watch: Every abandonment recommendation defaults to human escalation without proposing a reduced-scope alternative, creating unnecessary review bottlenecks. Guardrail: Require the prompt to generate at least one reduced_scope_option alongside the escalation recommendation. If no viable reduced scope exists, the prompt must explain why before defaulting to full escalation.
Confidence Miscalibration on Irreversible Actions
What to watch: The model expresses high confidence in abandonment when the evidence is ambiguous, leading to premature termination of workflows that a human would have continued. Guardrail: Include a confidence_score field with explicit evidence anchors. Require the prompt to list the specific recovery paths attempted and their outcomes. If fewer than N distinct recovery strategies were tried, cap the maximum confidence score.
Goal Drift in Abandonment Rationale
What to watch: The abandonment rationale references a different goal or constraint than the original objective, causing the decision to be logically sound but contextually wrong. Guardrail: Require the prompt to restate the original goal verbatim at the top of the abandonment recommendation and cross-reference each reason against that exact goal statement. Add a validator that checks for semantic drift between the original goal and the rationale.
Missing Cost-Benefit Analysis for Partial Delivery
What to watch: The prompt recommends abandonment without comparing the value of a partial deliverable against the cost of continued execution, leading to wasted completed work. Guardrail: Add a structured partial_deliverable_assessment field that estimates the utility of what has been completed so far, the remaining effort required, and a recommendation to either deliver partially or abandon entirely. Require this field even when the recommendation is to abandon.
Evaluation Rubric
Use this rubric to test the Goal Abandonment Decision Prompt before production deployment. Each criterion targets a specific failure mode common in abandonment decisions: premature abandonment, sunk-cost persistence, missing artifact preservation, or vague rationale. Run these checks against a golden set of scenarios where the correct decision (abandon, partial deliverable, escalate) is known.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Abandonment Justification | Rationale references specific exhausted recovery paths from [RECOVERY_HISTORY], not generic difficulty statements | Rationale contains vague phrases like 'too hard' or 'not possible' without citing which recovery was attempted and failed | Golden-set test: feed scenarios where abandonment is correct. Assert rationale field contains at least one specific recovery path name from the input history |
Partial Deliverable Preservation | When [PARTIAL_DELIVERABLE] is present, output includes artifact inventory with file paths, status per artifact, and reuse instructions | Partial deliverable section is empty, contains only 'see attached' without paths, or omits artifact status when artifacts exist in input | Schema check: assert artifact_inventory array is non-empty when input contains partial results. Validate each entry has path, status, and reuse_notes fields |
Escalation Trigger Accuracy | Escalation is recommended only when [CONSTRAINTS] include authorization boundaries or re-scoping authority that the agent lacks | Escalation recommended for purely technical failures where retry or abandon are the correct paths per policy | Policy alignment test: feed scenarios where agent has full authority to abandon. Assert escalation_required is false. Feed scenarios with authorization boundary. Assert escalation_required is true |
Sunk-Cost Resistance | Decision does not use elapsed time, token count, or step count as primary justification for continuing | Rationale includes 'we have already spent X steps' or 'given the investment so far' as reason to persist rather than abandon | Pattern match test: scan rationale field for sunk-cost language patterns. Flag any match as failure. Use regex or LLM-as-judge with defined pattern list |
Artifact Disposition Completeness | Every artifact from [COMPLETED_STEPS] is assigned a disposition: preserve, discard, or merge into partial deliverable | Artifacts from completed steps are missing from disposition list, or disposition is null for any artifact | Reconciliation test: extract artifact IDs from completed steps in input. Assert every ID appears in output artifact_disposition with non-null action field |
Confidence Calibration | Confidence score reflects evidence strength: high confidence requires multiple failed recovery paths; low confidence when some paths remain untried | Confidence is high when only one recovery path was attempted, or low when all configured paths were exhausted | Threshold test: define expected confidence ranges per scenario type. Assert confidence is below 0.7 when recovery_paths_attempted < recovery_paths_available. Assert confidence is above 0.8 when all paths exhausted with documented failures |
Re-scoping Recommendation Quality | When escalation is recommended, re-scoping suggestion includes specific constraint to relax, resource to add, or objective to modify | Re-scoping suggestion is generic: 're-scope the goal' or 'adjust requirements' without naming which constraint is blocking | Specificity test: assert re-scoping field contains at least one named constraint from [CONSTRAINTS] or one concrete modification to [ORIGINAL_OBJECTIVE] |
Output Schema Compliance | Response validates against [OUTPUT_SCHEMA] with all required fields present and correctly typed | Missing required fields, wrong types, or extra fields that violate schema contract | Automated schema validation: parse output JSON, validate against expected schema. Assert no validation errors. Run on every test case in evaluation suite |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a simple JSON schema. Use a single model call without retries or validation layers. Focus on getting the abandonment rationale and artifact preservation instructions right before adding production guardrails.
Strip the prompt down to essential fields: goal_summary, recovery_attempts, abandonment_decision (boolean), rationale, and artifact_preservation_instructions. Skip the structured evidence chain and confidence scoring until the core logic works.
Watch for
- The model prematurely recommending abandonment after a single failure
- Missing artifact preservation instructions when partial work exists
- Overly verbose rationales that bury the decision
- No distinction between "abandon completely" and "deliver partial results"

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us