Skip to content

Containment lifecycle: update status after approval, remind only for applied blocks, list active containment #209

Backlog

Description

@OkiriGabriel

Context

#168 (PR #202) records each containment request as containment-<action_id>.json with status: "pending_approval", and IP blocks also under {org}/containment_expiry/.

Problems

  1. The status never changes. When the action is approved and runs (or fails, or is rejected, or the approval expires), the record still says pending_approval. There's no way to answer "which pods are isolated right now?".
  2. Expiry reminders fire for blocks that were never applied. remind_expired_blocks reminds about every block request that reached its expires_at, including ones nobody approved, and tells people to remove a rule that doesn't exist.
  3. Expiry counts from the request, not from when it was applied.

Proposed fix

  • Link the approval reference to the containment record. On execution, set status to applied/failed with applied_at; on rejection, rejected; when the approval expires, expired. This builds on the approved-action audit issue.
  • Set expires_at from applied_at, and send reminders only for applied blocks.
  • GET /orgs/{org}/containment?status=applied (viewer) and an MCP tool list_containment showing active isolations, cordons, disabled keys and blocks with their reverse commands.
  • Tests: the full lifecycle; no reminder for an unapproved block; the listing.

Files

tools/containment.py, agent/core.py, api/server.py, devops_mcp/registry.py, docs/THREAT_DETECTION.md

Activity

  1. added
    enhancement
    security
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions