> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thoras.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Pod Annotations

> Reference for the thoras.ai/ annotations Thoras writes to pods, and what they do and don't guarantee.

## Overview

When the vertical scaling admission webhook mutates a pod's resource requests
(or limits) in `autonomous` mode, it annotates the pod:

```yaml theme={null}
metadata:
  annotations:
    thoras.ai/managed: "true"
    thoras.ai/scaler: "prod/api-server"
    thoras.ai/admitted-at: "2026-08-19T14:02:11Z"
```

| Annotation              | Description                                                                                   |
| ----------------------- | --------------------------------------------------------------------------------------------- |
| `thoras.ai/managed`     | `"true"` if the webhook wrote at least one resource request or limit on this pod.             |
| `thoras.ai/scaler`      | `<namespace>/<name>` of the `AIScaleTarget` or `DaemonSetAutoscaler` that drove the mutation. |
| `thoras.ai/admitted-at` | RFC 3339 timestamp of when the webhook mutated the pod, set once at admission.                |

These are written once, at pod admission (`CREATE`), by the mutating webhook
only — not by [in-place resize](/guides/vertical-pod-rightsizing#update-policy),
which patches running pods directly without going through admission.

<Note>
  This is scoped to the pod-mutating webhook, which covers both vertical
  `AIScaleTarget` rightsizing and initial resource seeding by a
  `DaemonSetAutoscaler`. Horizontal scaling (replica count), which mutates the
  `*/scale` subresource instead of the pod, is a separate webhook and does
  not set these annotations.
</Note>

## What This Answers

`thoras.ai/managed: "true"` means **"the webhook set this pod's resources
at admission,"** and nothing stronger. Use it to answer: did Thoras's
mutating webhook write to this pod's `resources`, as opposed to the
controller's pod template, another mutating webhook, or a manual
`kubectl edit`.

It does **not** mean "Thoras currently manages this pod." Two situations
produce a pod that is annotated `managed: "true"` but is no longer
representative of Thoras's current recommendation:

### Pods Predate Autonomous Mode

An `AIScaleTarget` switched into `autonomous` mode only annotates pods that
are admitted (created) after the switch. Pods that were already running keep
being resized in place by the disruption worker and are never re-admitted, so
they stay unannotated until they're naturally recreated (a rollout, eviction,
node drain, or manual restart). Once a pod turns over, it goes through the
webhook and picks up the annotation on its next admission.

### The Annotation Isn't Cleared When Thoras Stops Managing a Pod

Switching an `AIScaleTarget` out of `autonomous` mode, or unenrolling it (see
[Stopping Autonomous Scaling](/guides/stopping-autoscaling)), reverts running
pods to their controller's template values with an in-place resize wherever
possible — the pods are not recreated, so they are never re-admitted and the
webhook never runs again to clear the annotation. A reverted pod keeps
`thoras.ai/managed: "true"` while sitting at template values. As with the
case above, this self-heals the next time the pod is recreated for any
reason: a fresh admission with nothing to mutate does not set the annotation.

When the in-place revert can't apply (for example, the template declares a
different set of resource keys than the running pod, which would change its
QoS class) and the update policy permits recreation, Thoras falls back to
restarting the workload — those pods are recreated and come back without the
annotation.

Both cases are false positives on a pod Thoras did mutate at some earlier
admission, consistent with the annotation's actual meaning — never false
positives claiming Thoras is currently managing a pod it isn't.

## Related Documentation

* [Predictive Vertical Pod Rightsizing](/guides/vertical-pod-rightsizing) -
  Configuring `autonomous` mode and update policy
* [Stopping Autonomous Scaling](/guides/stopping-autoscaling) - How pods
  revert when autonomous mode is turned off
* [ClusterAIScaleTemplate](/reference/cluster-aiscale-template) - The
  `thoras.ai/skip-template` and `thoras.ai/managed-by-template` annotations
  and labels, which control template enrollment rather than pod mutation
