# Stale guest cleanup

Builds a capped disable plan for enabled guest accounts with stale sign-in activity, external-state context, and per-guest rationale.

## Classification

| Field               | Value                  |
| ------------------- | ---------------------- |
| Agent ID            | `stale-guest-cleanup`  |
| Version             | `1.1.0`                |
| Mode                | `write`                |
| Tier                | `agent`                |
| Category            | `policies`             |
| Required Entra tier | `p1`                   |
| Preferred model     | `llama3.1:8b`          |
| Minimum app version | `0.1.0`                |
| Author              | OpenAdminOS · verified |
| Last changed        | 2026-05-29 · `3a69fc6` |

## Tenant Data Access

| Step                | Graph call   | Scopes                                                              |
| ------------------- | ------------ | ------------------------------------------------------------------- |
| Load guest accounts | `GET /users` | <p><code>User.Read.All</code><br><code>AuditLog.Read.All</code></p> |

## Graph Scopes

* `AuditLog.Read.All`
* `User.Read.All`
* `User.ReadWrite.All`

## Write Behavior

| Step                     | Action      | Confirmation       | Scopes               |
| ------------------------ | ----------- | ------------------ | -------------------- |
| Disable each stale guest | Graph write | `DISABLE N GUESTS` | `User.ReadWrite.All` |

Write agents always pause for confirmation in OpenAdminOS. Destructive operations require the typed confirmation phrase shown by the app.

## LLM Use

| Step                                      | Settings                        |
| ----------------------------------------- | ------------------------------- |
| Explain why this guest should be disabled | temperature 0.1 · max tokens 80 |

## Settings

| Setting        | Type    | Default | Description                                                                 |
| -------------- | ------- | ------- | --------------------------------------------------------------------------- |
| `inactiveDays` | integer | `90`    | Enabled guests inactive at least this many days are considered for disable. |

## Source

* [Agent source](https://github.com/OpenAdminOS/OpenAdminOS/tree/main/agents/stale-guest-cleanup)
* [Manifest](https://github.com/OpenAdminOS/OpenAdminOS/blob/main/agents/stale-guest-cleanup/manifest.yaml)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openadminos.com/agents/stale-guest-cleanup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
