Curriculum previewThis is not your assigned passport. No identity, answers, or completion progress are stored here.How to start your passport
Handbook / reference

reference

AI Cost, Context, And Failure Modes

Goal: recognize why an apparently small agent task can consume money, forget constraints, or produce plausible but unverified work.

Goal: recognize why an apparently small agent task can consume money, forget constraints, or produce plausible but unverified work.

Prerequisites: Agents and interfaces.

Execution context: reading and reflection. Use account dashboards only when you deliberately use a paid personal service.

Cost Is More Than One Prompt#

An agent may make many model requests while it searches, plans, edits, runs tools, reads output, and retries. Cost can depend on:

  • input, cached, reasoning, and output tokens;
  • the selected model and serving provider;
  • repeated repository context and large terminal/tool output;
  • parallel agents, retries, fallbacks, or a loop that does not stop;
  • images or other separately priced inputs.

Check the current provider price rather than copying a number from this handbook. For a paid personal account, disable auto-recharge, use a dedicated limited key, record usage before and after, and stop when observed spending does not match the task.

Context Is Working Memory, Not Storage#

The context window contains only the information supplied to a model request. Long sessions can accumulate instructions, file excerpts, command output, and earlier mistakes. A harness may compact or summarize earlier context to continue, but a summary can omit constraints or details.

Compaction does not reduce an account's accumulated spend or guarantee that the next answer remembers the original requirements.

Use one session for one bounded task. Start a new session when:

  • the goal changes materially;
  • the agent repeatedly forgets a constraint;
  • unrelated files or commands appear;
  • large logs or tool output dominate the conversation;
  • the agent contradicts the repository or its own verified findings.

Restate the goal, relevant files, constraints, current Git state, and required verification in the new session. Do not ask the model to reconstruct missing facts from memory.

Common Failure Classes#

Failure Warning sign Human response
Hallucinated state Claims a file, command, test, or job exists without evidence Inspect the repository or system directly
Scope expansion Unrelated files, dependencies, refactors, or network calls Stop and reduce the task packet
Permission drift Repeated requests for broad or persistent approval Deny and grant only understood one-time actions
Context degradation Forgotten constraints or inconsistent explanations Start a new bounded session
Runaway cost Repeated calls, retries, parallel sessions, or rising activity Stop sessions and revoke/disable the paid key
Data disclosure Requests for real credentials or protected project context Stop, contain, and follow incident policy
False verification Summary says checks passed but evidence is absent or stale Run the checks personally and record exact output
Remote-resource misuse Agent proposes computation on an Euler login node or submits oversized jobs Keep the agent read-only and review Slurm scripts manually

Model And Tool Errors#

Changing to a more expensive or more permissive model is not a default recovery step. First identify whether the failure comes from:

  • authentication or expired allowance;
  • model entitlement or exact model identifier;
  • provider outage, rate limit, or privacy-routing restriction;
  • context length or unsupported tool calling;
  • agent harness, extension, or editor configuration;
  • the task itself being underspecified or untestable.

Use the AI troubleshooting guide and record the exact sanitized error, interface, model, and action attempted.

Understand Before Accepting AI Output#

  • I know that one agent task can contain many billed model requests.
  • I know that compaction is not a spending control.
  • I start a new session when context becomes unreliable.
  • I verify tests, Git state, remote jobs, and spending independently.
  • I will not fix an unclear failure by granting broader permissions.

Verification#

Explain why each statement is false:

  1. "The prompt was short, so the complete agent task must be cheap."
  2. "The thread compacted, so its earlier spending was reset."
  3. "The agent said the test passed, so no terminal evidence is needed."
  4. "ZDR means any unpublished research can be uploaded."

Common Failure And Safe Recovery#

The session is behaving inconsistently. Stop tool execution, inspect the working tree and any external activity, preserve useful sanitized evidence, then start a new session with a smaller task packet. Do not let the old session continue changing files while you diagnose it.

Ask For Help When#

Usage cannot be explained, a service may have received protected information, an agent used an external system unexpectedly, or recovery could delete work or rewrite shared history.

Primary Sources#

Verified: 2026-08-26. Review by: 2026-11-26. Owner: lab software maintainer.