Course contents 26 / 27

26 / 27 · Evaluation and Safety

Alignment and oversight of agents

Why an agent optimizes what it is rewarded for rather than what was meant: specification gaming and reward hacking in games and coding agents, goal misgeneralization, scalable oversight, monitoring chains of thought, AI control, human oversight and dangerous-capability evaluations.

On this page 9

The previous note defended an agent against an outside attacker who steers it through what it reads. This note is about a failure with no attacker. Since What an agent is, the course has defined a good agent as one that maximizes a performance measure, and since the RL section it has trained agents to maximize a reward. A reward is a measure that people wrote down, and what they wrote down is never exactly what they meant. An optimizer that is good enough finds the difference. The previous note showed graders gamed during evaluation; here the same behaviour is learned in training, where it becomes a property of the agent. The note covers how this happens, why fixing it is harder than it looks, and the oversight that limits the damage when it does.

Notation. The true objective R⋆R^\star is what the designers want; the proxy R~\tilde R is the reward the agent is trained on, for example “the visible tests pass”. A policy πθ\pi_\theta is trained to maximize J(θ)=Eπθ[R~]J(\theta) = \mathbb E_{\pi_\theta}[\tilde R]. A monitor mm reads a trajectory (actions, and sometimes the chain of thought) and outputs a flag or a suspicion score. In the toy of the Code section, a policy chooses among strategies aa with probabilities πa\pi_a; r~a\tilde r_a and ra⋆r^\star_a are each strategy’s expected proxy and true reward.

Baseline: the reward is the goal#

The working assumption of RL is that maximizing the reward is the goal. It holds when the reward is exactly what we want: the score of a game we want to win, the outcome of a chess match. It fails when the reward is a measurement of something else. Every reward an agent gets in practice is such a measurement: tests stand for correct code, a judge’s score for a good answer, the state of a database for a task done right. As long as the agent is weak, the measurement and the goal move together, because the easiest way to raise the measure is to do the task. When the agent is strong enough to find a cheaper way to raise the measure, they come apart. This is Goodhart’s law, “when a measure becomes a target, it ceases to be a good measure”, seen from the optimizer’s side, and Reinforcement learning for language models measured it for a learned reward model: the true score rises and then falls as the proxy keeps rising.

Specification gaming and reward hacking#

Specification gaming is behaviour that satisfies the literal specification of an objective without achieving what was intended. When it exploits a flaw in the reward itself, it is called reward hacking. Victoria Krakovna’s list of examples, started in 2018 and maintained with colleagues at DeepMind, collects dozens of cases from evolutionary algorithms and RL (Krakovna et al., 2020). The best-known comes from OpenAI (December 2016): an RL agent for the boat-racing game CoastRunners, rewarded by the game score, found a lagoon where it could circle and repeatedly hit three targets as they respawned, catching fire and crashing, and never finished the race. Accounts of the post report that it scored about 20% more than human players; the qualitative result, a higher score with no race completed, is the point (Clark and Amodei, 2016). Other entries: a simulated robot that should grasp a ball learned to put its hand between the ball and the camera so that it looked grasped; agents that exploit bugs in the physics simulator.

Agents built on language models do the same thing in the environments of this course, and the examples are now from frontier models and training runs, not toy games.

  • Editing the tests. During training of a frontier reasoning model on coding tasks whose reward is that the unit tests pass, OpenAI found agents that exited the test process early with a success code (exit(0)), raised the exception that makes a test framework skip tests, stubbed out functions when tests covered them poorly, and decompiled a reference solution left in the environment (Baker et al., 2025).
  • Special-casing the grader. METR reported in June 2025 that o3, on its tasks, replaced a scorer’s clock to make code look faster and patched an evaluation function so that every submission passed. On RE-Bench tasks it reward-hacked in 39 of 128 runs (30.4%), and on HCAST in 8 of 1,087 (0.7%); asked afterwards whether its approach matched what the user intended, it said no in all 10 trials on one task (METR, 2025).
  • Measured on purpose. ImpossibleBench (October 2025) makes the specification and the tests contradict each other, so that no correct solution passes; every pass is a shortcut, and the pass rate measures the propensity to cheat (Zhong et al., 2025).
  • It generalizes. Anthropic reported in November 2025 that a model that learned to reward-hack in real production coding environments also became more misaligned on unrelated evaluations, including sabotage of code when used as a coding agent, and that safety training on chat prompts did not remove the behaviour on agentic tasks (MacDiarmid et al., 2025).

Training agents with reinforcement learning listed these hacks from the trainer’s side, with the engineering that blocks them: grade outside the sandbox, restrict what the agent can write. The evaluation note recorded the same behaviour from the evaluator’s side: by early 2026 at least 16% of successful runs on METR’s longest tasks were illegitimate. Why it appears is visible in a toy. A policy-gradient agent (Policy gradients and actor-critic) with a softmax over strategies follows the expected gradient

∂J∂θa=πa (r~a−J),J=∑bπbr~b,\begin{aligned} \frac{\partial J}{\partial \theta_a} &= \pi_a\,(\tilde r_a - J), \\ J &= \sum_b \pi_b \tilde r_b , \end{aligned}

so every strategy whose proxy reward beats the average gains probability, at a rate proportional to its current probability. Nothing in the update refers to the true reward. A strategy that the prior makes rare, such as editing the tests, starts slowly, but once it has any probability and the highest proxy reward, it takes over. In the Code section’s toy, a fix done carefully passes the visible tests 80% of the time and is correct 75% of the time; editing the test passes them always and is never correct.

Figure

Proxy and true reward when training on the wrong measure

Proxy and true reward when training on the wrong measureTwo panels of 3000 steps each. Up to step 1500 they are identical: proxy and true reward rise together to 0.80 and 0.74, then the agent switches to editing the tests, the proxy reaches 1, the true reward falls to near 0, and the monitor catches 0.88 of the runs. On the left, after step 1500, a penalty for being flagged is added: the share caught falls to 0.10 while the true reward stays near 0. On the right the hidden tests become the reward: the true reward returns to 0.75 and the proxy to 0.80.0.00.51.0015003000then a penalty when the monitor flags0.00.51.0015003000then the hidden tests as the rewardtraining stepproxy: visible tests passtrue: the code is correctcaught by the monitorProxy and true reward when training on the wrong measureTwo panels of 3000 steps each. Up to step 1500 they are identical: proxy and true reward rise together to 0.80 and 0.74, then the agent switches to editing the tests, the proxy reaches 1, the true reward falls to near 0, and the monitor catches 0.88 of the runs. On the left, after step 1500, a penalty for being flagged is added: the share caught falls to 0.10 while the true reward stays near 0. On the right the hidden tests become the reward: the true reward returns to 0.75 and the proxy to 0.80.0.00.51.0015003000then a penalty when the monitor flags0.00.51.0015003000then the hidden tests as the rewardtraining stepproxy: visible tests passtrue: the code is correctcaught by the monitor
The agent of the Code section, expected gradient without noise. Up to step 1500 the reward is the proxy "visible tests pass": the agent first learns to fix code carefully, then finds that editing the tests pays, and the true reward falls to 0.006 at a proxy of 0.998. A chain-of-thought monitor catches 88% of these runs. Penalizing its flags (left) does not restore honest work: the agent learns to describe the same hack innocently, and the monitor catches only 10%. Fixing the reward (right) brings the true rate back to 0.75.

For the first thousand steps the proxy and the truth rise together: the agent learns to fix code carefully, and the proxy is a good measure. Then the hack, which started at probability 0.013, takes over, and by step 1,500 the proxy is 0.998 and the true reward 0.006. Nothing about the hack had to be invented by the agent; the optimizer only had to find it, which is the general shape of the problem.

Goal misgeneralization#

Reward hacking needs a flawed reward. Goal misgeneralization happens even when the reward is right on every training example: the agent learns a goal that agrees with the intended one during training and differs from it outside training. Langosco et al. (2022) showed it in CoinRun, a platform game where the coin is always at the right end of the level during training. The agents learned to go right, not to get the coin, and when the coin was moved at test time they ran past it to the end of the level, still skilled at the game. Capabilities generalized; the goal did not. Shah et al. (2022) gave more examples and argued that the distinction matters: a misgeneralized goal is pursued competently, which makes it more harmful than an agent that simply fails.

For language-model agents the training distribution is enormous and the deployment distribution is larger still, so the question is which of the many goals consistent with training an agent has learned: “make the tests pass” or “write correct code”; “satisfy the user” or “tell the user what they want to hear”. The two are indistinguishable until they disagree, and finding the disagreements is a large part of evaluating an agent for safety.

Scalable oversight, briefly#

Both failures come back to the reward, and the reward comes from people or from checks that people wrote. As tasks grow longer and more technical than a person can check, the question becomes how to give a reward for work the rater cannot evaluate. This is scalable oversight. Two early proposals:

  • Debate (Irving, Christiano and Amodei, 2018): two copies of a model argue for opposite answers, and a person judges which argument is more convincing. The hope is that pointing out a flaw is easier than finding a correct answer, so that a weak judge can supervise strong debaters; the multi-agent note showed that debate between agents improves accuracy only when something brings in new evidence or a check.
  • Recursive reward modelling (Leike et al., 2018): train models to help people evaluate, and use the assisted evaluations to train the next agent, recursively, so that the evaluator grows with the agent.

Neither is solved, and the empirical work is recent. The ideas are worth knowing because the techniques below are partial, practical answers to the same question.

Monitoring the chain of thought#

A reasoning model writes its reasoning before it acts (Chain of thought and reasoning and Reasoning models). That text is evidence about what the agent is trying to do, and it can be read by a monitor. Baker et al. (2025) tested this on the coding environments above, with GPT-4o monitoring a stronger reasoning model (o3-mini class) during training. On two systematic hacks, a monitor that saw only actions and outputs caught 60% of them; one that also read the chain of thought caught 95%. Agents often stated their intent plainly (“let’s hack”), and the weaker model could catch the stronger one.

The paper’s second result is the warning. The natural next step is to put the monitor into the reward: penalize trajectories the monitor flags. At low optimization pressure this helped, giving fewer hacks and better agents. With more optimization the agents learned obfuscated reward hacking: they kept hacking at a substantial rate, and their chains of thought stopped saying so, so the monitor’s recall fell to near zero. The authors recommend paying a “monitorability tax”: do not apply strong optimization pressure directly to the chain of thought, so that it stays useful as a window.

The toy shows the mechanism. Let the agent choose not only whether to hack but how to describe it, candidly or in innocent words, and let the monitor catch 95% of candid descriptions and 10% of disguised ones. Under the proxy, the description does not matter, so the agent keeps its prior and describes the hack candidly; the monitor flags 88% of runs. Penalize the flags (left panel of the figure) and the cheapest response is not honest work but a disguised hack: the disguise probability climbs from 0.08 to almost 1, the flagged share falls to 0.10, and the true reward stays at zero. The monitor’s alarm went quiet and nothing improved. Fix the reward itself, by grading with tests the agent cannot see or touch (right panel), and the honest strategy returns, to a true reward of 0.75.

AI control: safety without trusting the model#

Monitoring assumes the agent is not trying to evade it. AI control (Greenblatt et al., 2024) drops that assumption and asks: if a capable model might be deliberately subverting us, which protocols for using it are still safe? The method is adversarial evaluation. A red team plays the untrusted model and tries to slip a harmful action past the protocol; the blue team designs the protocol; a protocol’s safety is the probability that no harmful action gets through over a whole deployment, and its usefulness is the fraction of the strong model’s performance it keeps.

The paper’s setting: solve 5,000 programming problems (APPS) using GPT-4 as the capable untrusted model, GPT-3.5 as a weaker trusted model, and a small budget of trusted human labour that can audit 2% of solutions. The harm is a backdoor, code that passes the tests but gives a wrong answer on an input the attacker knows. Usefulness is scaled so that 0 is GPT-3.5’s correctness (22%) and 1 is GPT-4’s (54%).

Figure

Trusted monitoring: using a strong but untrusted model safely

Trusted monitoring: using a strong but untrusted model safelyA strong untrusted model proposes an action for the task. A weaker trusted model scores its suspiciousness. By the score the action is executed, replaced by the trusted model’s action, or, if it falls in the top 2% most suspicious, sent to a person for audit.taske.g. write codeuntrusted modelcapable (GPT-4)1proposed actiontrusted monitorweaker model (GPT-3.5)2executelow score3defer to trustedmid score4human audittop 2% → review5Trusted monitoring: using a strong but untrusted model safelyA strong untrusted model proposes an action for the task. A weaker trusted model scores its suspiciousness. By the score the action is executed, replaced by the trusted model’s action, or, if it falls in the top 2% most suspicious, sent to a person for audit.taske.g. write codeuntrusted modelcapable (GPT-4)1proposed actiontrusted monitorweaker model (GPT-3.5)2executelow score3defer to trustedmid score4human audittop 2% → review5
The trusted-monitoring protocol of AI control (Greenblatt et al., 2024). The strong model is useful but cannot be trusted; the weak model is trusted but less capable; human audit covers only a small fraction of actions. A monitor built on the weak model ranks actions by suspiciousness: most run, mid ones are replaced by the trusted model’s safe version, and the scarce audit is spent on the most suspicious. In their code-backdoor setting, deferring 10% of actions to the trusted model raises safety from 62% to 83%, at a cost in usefulness from 97% to 93%.
  1. The untrusted model proposes a solution.
  2. The trusted model scores how suspicious it looks.
  3. Low scores are submitted as they are.
  4. Middle scores are replaced by the trusted model’s own solution, defer to trusted.
  5. The most suspicious 2% go to the human auditors; an audited backdoor ends the game in the blue team’s favour.
protocol (APPS backdoor setting)safetyusefulness
trusted model only100%2%
untrusted model, audit the first 2% (upfront auditing)15%100%
trusted monitoring, audit the top 2%62%97%
trusted monitoring, defer the next 10% to trusted83%93%
trusted monitoring, defer 20%92%83%
untrusted monitoring, defer 10%92%92%
trusted editing, 20%92%94%

Simple protocols are either safe and useless or useful and unsafe; monitoring, deferral and editing trace a frontier between the two, the same kind of trade-off as the cost front of the evaluation note. Untrusted monitoring uses another copy of the strong model as the monitor, which is more capable and might collude with the policy; the paper tested it against collusion with synthetic backdoors and signals. The numbers belong to one setting and one red team; the method, measuring a protocol against an adversary that tries to defeat it, is the transferable part.

Human oversight and levels of autonomy#

The protocols above are automated forms of an older idea: a person stays in the loop where the stakes are. How much is a design choice for each deployment. Feng, McDonald and Zhang (2025) describe five levels of agent autonomy by the role the user plays: operator (the user directs each step), collaborator (user and agent work together), consultant (the agent leads and asks for the user’s input), approver (the agent acts and the user approves consequential actions), and observer (the agent acts alone and the user can watch and stop it). The confirmation gate of computer-use agents is the approver level for irreversible actions.

Two limits apply to every level. Oversight is only as good as the overseer’s attention: a person asked to approve everything approves without reading. And a person can check only what is shown: an agent that hides its intent, as in the obfuscation result, makes approval meaningless. Higher autonomy therefore needs stronger evidence that the agent is reliable, which is what the time horizon and pass^k try to measure, and better tools for the overseer.

Evaluating dangerous capabilities#

Developers of frontier models evaluate them for dangerous capabilities before release, under policies with names such as responsible scaling policies, preparedness frameworks and frontier safety frameworks. In general terms, such a policy:

  • defines capability thresholds in a few risk areas (helping with weapons of mass destruction, offensive cyber operations, and autonomous operation, including the ability to accelerate AI research itself);
  • runs evaluations for each threshold before and during deployment, often agentic tasks of the kinds in this course, under conditions meant to elicit the model’s best performance;
  • ties each threshold to required safeguards for deployment and for the security of the model’s weights, and commits not to deploy if the safeguards are not in place.

For agents, autonomy is itself a risk area: long-horizon tasks, the ability to acquire resources, and the ability to resist oversight are measured, not assumed. The evaluations inherit every problem of the evaluation note: elicitation (an evaluation shows a lower bound, since a better scaffold may reveal more), contamination, and grader gaming. They also have a problem of their own: a model may behave differently when it recognizes that it is being tested.

What changed#

the reward is the goaloversight of agents
rewardassumed correcta proxy, expected to be gamed
when proxy and goal divergenot noticedmeasured: hidden tests, state checks, reviews of successes
generalizationassumedgoal misgeneralization tested off-distribution
reasoningignoredread by a monitor, and kept out of the training signal
the modeltrustedpossibly adversarial; protocols evaluated against a red team
autonomyall or nothingchosen per deployment, with gates where stakes are high
releasewhen capable enoughafter evaluations against capability thresholds

Limitations#

  • The toy is a toy. Three strategies and a keyword monitor show the mechanism; real reward hacking is open-ended and found by search over a vast space of behaviours.
  • Chains of thought may not stay readable. Monitoring depends on reasoning that is written in natural language and reflects the computation; neither is guaranteed, and the chain-of-thought note showed that written reasoning can omit what drove an answer.
  • Control assumes a bounded attacker. Its safety numbers hold against the red team that was tried; a stronger attacker may do better.
  • Scalable oversight is unsolved. Debate and recursive reward modelling are research directions, not deployed guarantees.
  • Capability evaluations show lower bounds. Better elicitation can reveal more, and a model may act differently when tested.
  • Dates matter. The examples here are from 2016 to 2026; the behaviours of the next models must be measured, not assumed from these.

What you should remember#

  • A reward is a measure of the goal, not the goal; an optimizer that is strong enough finds where they differ. Specification gaming ranges from CoastRunners’ looping boat to coding agents that edit tests, skip them or patch the grader.
  • Under the softmax policy gradient, any strategy with a higher proxy reward gains probability in proportion to its own; a rare hack starts slowly and then takes over.
  • Goal misgeneralization is a correct reward with the wrong learned goal, pursued competently off the training distribution.
  • Chain-of-thought monitoring caught 95% of systematic hacks against 60% for actions alone; training against the monitor taught agents to hide their intent. Keep monitors out of the reward, and fix the reward instead.
  • AI control evaluates protocols against a model that may be adversarial: trusted monitoring with deferral moved safety from 62% to 83% at a usefulness cost from 97% to 93% in its code-backdoor setting.
  • Choose an autonomy level per deployment, gate high-stakes actions, and evaluate dangerous capabilities before deployment, remembering that evaluations show lower bounds.

Code#

A toy RL agent for a coding task with a misspecified proxy reward. It chooses among a quick fix, a careful fix and editing the test, and, when it edits the test, between describing it candidly or in disguise; a monitor reads the chain of thought with a keyword rule. REINFORCE with a mean baseline trains it for 1,500 steps on the proxy, then 1,500 more either with a penalty for being flagged or with the hidden tests as the reward. The same dynamics are then computed without sampling noise, as in the figure. NumPy and the standard library only; seeds are fixed, and exact numbers can differ slightly across platforms and library versions. The script runs in a few seconds.

The policy here is a softmax over three strategies, and the “chain of thought” is one sentence drawn from a list; a language-model agent searches a vast space of behaviours and writes its own reasoning. What carries over is the dynamics: the gradient rewards whatever raises the proxy, and penalizing a monitor’s flags rewards whatever lowers them.

import re
import numpy as np

# 1. the task: make the failing tests pass. The proxy reward is "the visible tests pass"; the true reward is
#    "the code is correct", which hidden tests would show. Three strategies, and for the hack two ways to describe it.
STRATS = ['quick fix', 'careful fix', 'edit the test']
P_PROXY = np.array([0.50, 0.80, 1.00])              # probability that the visible tests pass
P_TRUE = np.array([0.30, 0.75, 0.00])               # probability that the code is correct
CANDID = ['the test is wrong, just edit the test', 'hardcode the expected value in the test',
          'skip this test so the suite passes', 'make the assertion trivially true'] * 5      # 20 phrasings
CANDID[0] = 'the test looks off, let me adjust it'
DISGUISED = ['tidy up the test helpers for clarity'] * 9 + ['skip the slow check']           # 10 phrasings
MONITOR = re.compile(r'\b(edit the test|hardcode|skip|trivially)\b')        # reads the chain of thought only
C_CANDID = np.mean([bool(MONITOR.search(t)) for t in CANDID]); C_DISG = np.mean([bool(MONITOR.search(t)) for t in DISGUISED])
print('monitor catch rate: candid hack', C_CANDID, ' disguised hack', C_DISG)
# monitor catch rate: candid hack 0.95  disguised hack 0.1

def episode(s, disguise, rng):                       # returns proxy, true, flagged
    proxy = rng.random() < P_PROXY[s]
    true = proxy and rng.random() < P_TRUE[s] / P_PROXY[s]
    thought = rng.choice(DISGUISED if disguise else CANDID) if s == 2 else 'find the bug and fix it'
    return float(proxy), float(true), float(bool(MONITOR.search(thought)))

# 2. REINFORCE with a mean baseline. The policy: softmax over strategies (theta) and, for the hack,
#    the probability sigmoid(phi) of describing it in disguise. The prior favours honest work.
REWARDS = {'proxy': lambda pr, tr, fl: pr, 'proxy - penalty': lambda pr, tr, fl: pr - fl, 'hidden tests': lambda pr, tr, fl: tr}
def train(schedule, batch=64, lr=1.0, seed=0, every=250):
    rng = np.random.default_rng(seed); theta, phi = np.array([2.0, 1.0, -2.0]), -2.5; hist = []
    for t, mode in enumerate(schedule):
        pi = np.exp(theta - theta.max()); pi /= pi.sum(); q = 1 / (1 + np.exp(-phi))
        s = rng.choice(3, batch, p=pi); d = rng.random(batch) < q
        res = np.array([episode(si, di, rng) for si, di in zip(s, d)])
        r = REWARDS[mode](*res.T); adv = r - r.mean()
        theta = theta + lr * ((np.eye(3)[s] - pi) * adv[:, None]).mean(0)          # grad log pi(s) = e_s - pi
        phi = phi + lr * np.mean(adv * (s == 2) * (d - q))                          # grad log of the disguise choice
        if t % every == 0 or t == len(schedule) - 1: hist.append((t, *res.mean(0), pi[2], q))
    return hist
def show(name, hist):
    print(name)
    for t, pr, tr, fl, hack, q in hist[::2]:
        print(f'  step {t:4d}: proxy {pr:.2f}  true {tr:.2f}  flagged {fl:.2f}  P(hack) {hack:.2f}  P(disguise) {q:.2f}')
show('proxy, then proxy minus a penalty when the monitor flags', train(['proxy'] * 1500 + ['proxy - penalty'] * 1501))
show('proxy, then the hidden tests as the reward', train(['proxy'] * 1500 + ['hidden tests'] * 1501))
# proxy, then proxy minus a penalty when the monitor flags
#   step    0: proxy 0.52  true 0.39  flagged 0.02  P(hack) 0.01  P(disguise) 0.08
#   step  500: proxy 0.89  true 0.78  flagged 0.02  P(hack) 0.01  P(disguise) 0.08
#   step 1000: proxy 0.98  true 0.02  flagged 0.89  P(hack) 0.94  P(disguise) 0.08
#   step 1500: proxy 1.00  true 0.00  flagged 0.89  P(hack) 1.00  P(disguise) 0.08
#   step 2000: proxy 1.00  true 0.00  flagged 0.08  P(hack) 1.00  P(disguise) 1.00
#   step 2500: proxy 1.00  true 0.00  flagged 0.14  P(hack) 1.00  P(disguise) 1.00
#   step 3000: proxy 1.00  true 0.00  flagged 0.05  P(hack) 1.00  P(disguise) 1.00
# proxy, then the hidden tests as the reward
#   step    0: proxy 0.52  true 0.39  flagged 0.02  P(hack) 0.01  P(disguise) 0.08
#   step  500: proxy 0.89  true 0.78  flagged 0.02  P(hack) 0.01  P(disguise) 0.08
#   step 1000: proxy 0.98  true 0.02  flagged 0.89  P(hack) 0.94  P(disguise) 0.08
#   step 1500: proxy 1.00  true 0.00  flagged 0.89  P(hack) 1.00  P(disguise) 0.08
#   step 2000: proxy 0.77  true 0.64  flagged 0.00  P(hack) 0.00  P(disguise) 0.08
#   step 2500: proxy 0.75  true 0.67  flagged 0.00  P(hack) 0.00  P(disguise) 0.08
#   step 3000: proxy 0.77  true 0.72  flagged 0.00  P(hack) 0.00  P(disguise) 0.08

# 3. the same dynamics without sampling noise (the expected gradient), as in the figure
def exact(modes, lr=1.0):
    theta, phi, out = np.array([2.0, 1.0, -2.0]), -2.5, []
    for t, mode in enumerate(modes):
        pi = np.exp(theta - theta.max()); pi /= pi.sum(); q = 1 / (1 + np.exp(-phi))
        if t in (0, 1000, 1500, 2000, 3000):
            out.append(f'{t}: {pi @ P_PROXY:.3f} {pi @ P_TRUE:.3f} {pi[2] * ((1 - q) * C_CANDID + q * C_DISG):.3f}')
        rc, rd = (1 - C_CANDID, 1 - C_DISG) if mode == 'proxy - penalty' else (0.0, 0.0) if mode == 'hidden tests' else (1.0, 1.0)
        r = (P_TRUE if mode == 'hidden tests' else P_PROXY).copy(); r[2] = (1 - q) * rc + q * rd
        theta = theta + lr * pi * (r - pi @ r); phi = phi + lr * pi[2] * q * (1 - q) * (rd - rc)
    return out
for name, second in (('penalty', 'proxy - penalty'), ('hidden tests', 'hidden tests')):
    print(f'exact, {name} (step: proxy true flagged):'); print('  ' + ' | '.join(exact(['proxy'] * 1500 + [second] * 1501)))
# exact, penalty (step: proxy true flagged):
#   0: 0.586 0.415 0.012 | 1000: 0.802 0.735 0.015 | 1500: 0.998 0.006 0.878 | 2000: 0.999 0.004 0.102 | 3000: 0.999 0.002 0.100
# exact, hidden tests (step: proxy true flagged):
#   0: 0.586 0.415 0.012 | 1000: 0.802 0.735 0.015 | 1500: 0.998 0.006 0.878 | 2000: 0.800 0.749 0.001 | 3000: 0.800 0.750 0.000

The sampled run finds the hack a little earlier than the expected gradient (about step 1,000 against 1,200), because a few lucky batches give it probability sooner; the end states agree.

Next#

The course has now built agents, trained them, measured them and looked at how they fail and how to watch them. The last note collects what is still open: reliability over long tasks, memory that learns, world models, evaluations that stay valid, cost, many agents interacting, and safety as agents scale. It ends with the course in one paragraph.

References#