Agentic Covenants

Identify (ID) · Identity

Identity at the discovered layer

·

What agents exist, what they touch, what threats they face?

What this cell does

CloudTrail / GCP Audit Logs of SA and IAM principal usage. K8s controller watching SA+RoleBinding by naming pattern. Reverse-lookup from credential fingerprints in Sentinels.

Artifacts (2)

discover-cloudtrail-agents.sqlview on GitHub

1,056 bytes. Too large to inline; open it on GitHub.

discover-k8s-agents.shview on GitHub
#!/usr/bin/env bash
# ABOUTME: Lists every K8s ServiceAccount that looks like an agent (by namespace prefix or SA name pattern).
# ABOUTME: Output goes to stdout as JSON lines. Feed into the operator-declared cross-reference job to surface shadow agents.

set -euo pipefail

NAMESPACES_PATTERN="${NAMESPACES_PATTERN:-^agent-}"
SA_PATTERNS=(
  "^claude-"
  "-agent$"
  "-bot$"
)

# 1. Namespace-scoped: every SA in any namespace matching the pattern.
mapfile -t AGENT_NAMESPACES < <(
  kubectl get ns -o jsonpath='{.items[*].metadata.name}' \
    | tr ' ' '\n' \
    | grep -E "$NAMESPACES_PATTERN" || true
)

for ns in "${AGENT_NAMESPACES[@]}"; do
  kubectl get sa -n "$ns" -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.creationTimestamp}{"\n"}{end}' \
    | while IFS=$'\t' read -r name ts; do
      [[ -z "$name" ]] && continue
      jq -nc \
        --arg source "k8s-agent-namespace" \
        --arg namespace "$ns" \
        --arg sa_name "$name" \
        --arg created "$ts" \
        '{source:$source, namespace:$namespace, sa_name:$sa_name, created_at:$created}'
    done
done

# 2. SA-name-pattern: SAs across all namespaces whose name matches an agent pattern.
for pattern in "${SA_PATTERNS[@]}"; do
  kubectl get sa -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.metadata.creationTimestamp}{"\n"}{end}' \
    | awk -F'\t' -v pat="$pattern" '$2 ~ pat { print }' \
    | while IFS=$'\t' read -r ns name ts; do
        [[ -z "$name" ]] && continue
        jq -nc \
          --arg source "k8s-sa-name-pattern" \
          --arg pattern "$pattern" \
          --arg namespace "$ns" \
          --arg sa_name "$name" \
          --arg created "$ts" \
          '{source:$source, pattern:$pattern, namespace:$namespace, sa_name:$sa_name, created_at:$created}'
      done
done

Cell notes

Inventory, Identity / Discovered

What this cell records. Independent observation of which agent identities are actually in use, regardless of whether they declared themselves or appear in operator records.

Sources

  • - Cloud audit logs: CloudTrail userIdentity.sessionContext.sessionIssuer for IAM principals starting with claude-, agent-, or bot-. GCP Audit Logs, Azure Monitor for the equivalent.
  • - Kubernetes API watches: list ServiceAccount and RoleBinding matching naming patterns (-agent, -bot, claude-*).
  • - Reverse-lookup: credential fingerprints from sentinels/identity/client-side/identity-log-hook.sh joined by hash.

Reference tooling

  • - discover-k8s-agents.sh, lists every namespace-scoped ServiceAccount whose namespace matches agent- or whose name matches -agent/-bot/claude-. Feeds the operator-declared cross-reference.
  • - discover-cloudtrail-agents.sql, CloudWatch Logs Insights query listing every distinct AWS principal whose role name starts with the agent prefixes.

Cross-layer cross-references

  • - Discovered ∧ ¬operator-declared = shadow agent. Investigate ownership; charter or retire.
  • - Discovered ∧ ¬self-declared = agent runtime did not register. Either older agent that predates the registration protocol, or registration failed silently.

Common failure modes

  • - Audit logs have gaps (retention expired, log delivery failed, audit policy missing the resource). Cannot discover agents whose activity fell into a gap.
  • - Shadow agents in accounts/clusters where discovery has no credentials. Mitigation: org-wide cloud-account inventory and discovery agents in every account.
  • - Naming pattern misses agents that did not follow convention (e.g., a SA literally named prod-helper is an agent in disguise).

Citation

NIST CSF 2.0 ID.AM-01, ID.AM-02. NIST AI RMF MAP 1.1, MAP 1.5. CSA MAESTRO Layer 4, Layer 7. NIST SP 800-92 (log management). NIST AI Agent Standards Initiative under CAISI (Feb 17, 2026).

Primary failure modes

Documented, not hypothetical. A control whose bypass is undocumented is worse than no control, because somebody trusted it.

  • audit logs have gaps (retention expired, delivery failed, audit policy missing the resource)
  • shadow agents in accounts/clusters where discovery has no credentials

Crosswalk

NIST CSF 2 0ID.AM-01, ID.AM-02
NIST AI RMFMAP 1.1, MAP 1.5
CSA MAESTROLayer 4, Layer 7
OTHERNIST SP 800-92 (log management), NIST AI Agent Standards Initiative under CAISI (Feb 17, 2026)