Metadata-Version: 2.5
Name: autoops-sre
Version: 0.1.7
Summary: An agentic ops harness for AIOps — SRE, cloud, Kubernetes, observability, and security automation.
Project-URL: Container image, https://github.com/users/epappas/packages/container/package/autoops
Author-email: Evangelos Pappas <epappas@evalonlabs.com>
License: MIT
License-File: LICENSE
Keywords: agent,aiops,harness,kubernetes,observability,sre
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.12
Requires-Dist: anthropic>=0.121.0
Requires-Dist: cedarpy<5,>=4.8.7
Requires-Dist: claude-agent-sdk==0.2.174
Requires-Dist: cryptography>=50
Requires-Dist: httpx>=0.28
Requires-Dist: mcp>=2.2.0
Requires-Dist: openai>=2.53.0
Requires-Dist: opentelemetry-api>=1.43.0
Requires-Dist: opentelemetry-sdk>=1.44.0
Requires-Dist: pydantic>=2.7
Requires-Dist: pyyaml>=6.0
Requires-Dist: starlette>=1.6.0
Requires-Dist: textual>=8.2.8
Requires-Dist: typer>=0.27.1
Requires-Dist: uvicorn>=0.52.4
Requires-Dist: websockets>=17.1
Description-Content-Type: text/markdown

# autoOps

An autonomous SRE agent. Point it at a Kubernetes namespace and it models the estate, names the
service that is broken, shows the evidence it used, and re-reads the cluster to check its own
answer — or hands a human a briefing saying why it could not.

Distribution **`autoops-sre`**; it installs the commands **`autoops`** and **`autoctl`**.

> The bare name `autoops` on PyPI is an unrelated project. Install `autoops-sre`.

## Install

For current source, use an **authorised checkout of current main containing `make install`**.
The development repository is private: this route requires access, not an anonymous download.
You need Git with reachable release tags and sufficient history, GNU Make, Python 3.12+ and
[uv](https://docs.astral.sh/uv/).

```bash
git clone git@github.com:epappas/autoops.git
cd autoops
make install
"$(uv tool dir --bin)/autoops" packet tests/fixtures/packets/daemonset-crashloop --results-dir ./out
```

The packet demo uses checkout fixtures (not bundled in the package), with no provider or cluster
contact. It is not live-state or transfer proof.

This builds a fresh sdist and wheel (`make dist` builds only), prints their persistent paths and
SHA256 hashes, installs the exact wheel with `uv tool install --force`, and runs that installed
binary outside the checkout to compare its version with wheel METADATA. It replaces an existing
uv tool installation of `autoops-sre`; set both `UV_TOOL_DIR` and `UV_TOOL_BIN_DIR` for isolation.
Use the exact installed binary path printed by the installer with `version` and `--help`, rather
than assuming a command on PATH is the same installation. Build tools and dependencies may still
need downloads or a populated uv cache. These targets do not publish anything.

Release tags give release versions; later commits and dirty checkouts give Hatch-derived development
versions. A tag must contain these targets to use this route; existing `v0.1.6` does not. Missing
release tags/history and inherited SCM version overrides are refused rather than using a fallback.

Without repository access, PyPI's latest published version is **0.1.4** (checked 31 October 2026).
It is older than current source; newer source is not being published to PyPI by this work:

```bash
uv tool install autoops-sre==0.1.4     # or: pip install autoops-sre==0.1.4 (Python 3.12+)
autoops version && autoops --help
```

Or as a container — the entrypoint is `autoops`:

```bash
docker pull ghcr.io/epappas/autoops:latest
docker run --rm ghcr.io/epappas/autoops:latest version
```

## First Run

On a loopback kind/k3s cluster (`KUBECONFIG` set to a file whose every server is a loopback
address), `autoops diagnose --namespace <ns>` runs with no approval. Any other cluster goes
through `init`, and needs two things first: a pinned kubeconfig carrying the minting ServiceAccount's
short-lived inline bearer and inline CA data, and read-mint RBAC installed by a cluster administrator.
`autoops init rbac` prints the packaged, unrendered recipe offline; its help explains operator-selected
HOME, signed approval, matching administrator server/CA and separate namespace bindings. Use the
estate-side checked installer, not an automatic apply: this command does not sign, apply or mint.
An `exec` user is refused even with a token. Certificate-only, auth-provider/OIDC-only and
tokenFile-only users cannot mint. An arbitrary opaque/OIDC bearer is not a ServiceAccount minting
identity; after the exec check, an inline token takes precedence over other user fields.

```bash
export KUBECONFIG=/path/to/one-cluster-kubeconfig.yaml
autoops init --namespace <ns>     # writes ./autoops.yaml and an unapproved target allowlist
# in autoops-init/crossing/allowlist.generated.yaml, add approved_by, approved_at, expires_at
# (explicit UTC offsets, at most 30 days apart); init prints the verify command to run next
autoops init verify --profile k8s-api-read --kubeconfig ... --target-allowlist ... --namespace <ns>
autoops diagnose
```

`init` never writes the three approval fields; until you add them, the cluster is refused. Bare
`autoops` on a terminal with no config asks the same questions. `diagnose` exits **0** with a
confident answer; **3** with an escalation briefing for a human (panel mode only); **4** when
nothing could be read; **5** when a detector named a broken object (under `--no-model` or
`--json`); **1** when no diagnosis was captured or the crossing or read-identity mint was refused;
**2** on a usage error. `diagnose --no-model` needs no model or key.

## What It Does

```
recall -> understand -> [detect -> map topology -> map services -> localize] -> rca -> mitigate -> remember
```

Perception is deterministic and comes first: 71 senses (`autoops capabilities` lists them), most
reading the Kubernetes API and some reading pod logs or Prometheus, nominate what looks broken.
`autoops capabilities` declares 17 data sources; on an approved cluster `diagnose` reads the
Kubernetes API, Prometheus, Jaeger, Loki, CloudWatch and Datadog metrics to confirm or refuse each
candidate. Elasticsearch and Splunk work on loopback clusters only; Azure Monitor, Google Cloud
Monitoring, and Datadog logs and traces are declared but not yet wired in. By default it changes
no workload or node.

### Acting, Only When You Allow It

`autoops diagnose --mitigate` (off by default) can scale a Deployment up, pause a Deployment
rollout, halt a DaemonSet rollout, or cordon worker nodes. Before anything changes, all of these
must admit: the approved target allowlist names the namespace; `--profile k8s-api-read` and five
`--mutation-*` inputs (approval file, two digest-pinned images, CA bundle, bearer token) are set;
the engine has an unambiguous cause; a bounded Claude Agent SDK session takes the one verb the
engine chose (its USD 0.25 cap applies only on the SDK's own authentication, not through
`AUTOOPS_SDK_GATEWAY_URL`); a separate human-written approval file, unexpired, names the verb,
namespace and kind, plus the workload for scale, pause and halt; Cedar policy re-checks the
proposal (never scale to zero; never cordon a node carrying the
`node-role.kubernetes.io/control-plane` or `node-role.kubernetes.io/master` taint; never drain,
evict, delete or uncordon); a short-lived credential is minted; and the command runs in a Docker
egress cage (Docker is needed on the host, and the image does not contain it). A cordon approval
names no nodes: the engine picks the set, and the cluster RBAC's `resourceNames` is the only limit
on which nodes. After the change, telemetry is re-read; if it does not confirm the result, the run
records a refusal. Only scale has bounded governed restoration after confirmed regression; pause,
halt and cordon undo remain manual (see Limits).

## Commands

`init`, `diagnose`, `watch`, `packet`, `offline`, `export`, `serve` (`http`, `mcp-stdio`),
`console`, `tui`, `chat`, `capabilities`, `eval` and `version`, plus bare `autoops`, which with a
config on a terminal starts a private loopback server and opens the terminal screen. `autoctl`
inspects an evidence tree; only `autoctl escalations respond` writes, appending a review record.
`serve http`, `console`, `tui` and `chat` refuse to start without `AUTOOPS_SERVE_TOKEN` (at least
32 characters) in the environment. `autoops <command> --help` is the documentation of record for
this distribution.

## Model Configuration

The OpenAI-compatible path has no default model: set `--model`, `model:` in the config, or
`OPENROUTER_MODEL`; without one, a command that needs a model refuses with exit 2. It uses
`OPENROUTER_API_KEY` and `OPENROUTER_BASE_URL` (default `https://openrouter.ai/api/v1`), or
`model_base_url` with `model_key_file` in the config. `chat` and the acting step use the Claude
Agent SDK with model `claude-opus-5` and the SDK's own authentication, unless
`AUTOOPS_SDK_GATEWAY_URL` and `AUTOOPS_SDK_GATEWAY_MODEL` are set together.

## Safety Notes

- `serve http` permits loopback HTTP only; `--allow-remote` is refused, even on loopback. Remote
  access needs a same-host TLS-terminating proxy forwarding to the authenticated loopback backend,
  never a plaintext network hop. Native TLS is not provided.
- "Loopback" means the API server address only: a tunnel or port-forward that puts a remote
  cluster on 127.0.0.1 is read with no approval.
- Read-only mode still sends API create calls (SelfSubjectRulesReview, TokenRequest), which appear
  in the cluster's audit log.
- A cordon acts on cluster-scoped nodes, while its approval is scoped to a namespace.
- `chat` and `--mitigate` run only on Linux x86_64 or aarch64.
- `diagnose` sends material it reads from the cluster to the model endpoint (openrouter.ai by
  default); `--no-model` sends nothing.
- Acting creates a Docker network and a proxy container (`autoops-mutation-net` and
  `autoops-mutation-proxy` by default).

## Limits

- Scale has bounded automatic restoration: after proven settlement, two consecutive complete bad
  workload-health samples within a 60-second observation window trigger an attempt to restore prior
  replicas. Authority and current replicas are re-checked through the governed chain; restoration
  can be refused. Pause, halt and cordon undo remain manual.
- `autoops init validate` (and `make validate` in a checkout) checks declared prerequisites locally:
  run id, budget, telemetry-directory access and config trust, plus a declared model key file or
  nonblank environment key for an explicitly configured model, and a declared kubeconfig's local
  structure and profile-specific requirements. Undeclared model/kubeconfig inputs print
  `not requested / not checked`. This does not authenticate to providers, contact clusters, or prove
  reachability or readiness.
- The demo packet and the offline fixtures are not in the wheel, sdist or image; `autoops packet`
  itself takes any directory with a `manifest.json`.
- Acting has been proven only on kind clusters the project built for it, not on an estate it was
  not built for.

## Verifying What You Installed

Local builds print SHA256 hashes and verify installed wheel metadata; these targets do not create
publish attestations. For a published package, inspect its PyPI provenance:

```bash
curl -f https://pypi.org/integrity/autoops-sre/0.1.4/autoops_sre-0.1.4-py3-none-any.whl/provenance
```

The container image carries a BuildKit SBOM and a max-detail provenance record on its manifest:

```bash
docker buildx imagetools inspect ghcr.io/epappas/autoops:latest
```

## Source And Support

The development repository is **private**, so this package page and the container package page are
the public surfaces. The sdist on PyPI (`autoops_sre-<version>.tar.gz`) contains the complete
`src/` tree under the MIT licence — that is the source for this distribution.

Container package: <https://github.com/users/epappas/packages/container/package/autoops>

## Licence

MIT.
