EnterpriseIdentity

Identity and authentication

See which directory identities DefenseClaw attributes agent activity to on Linux, Windows and macOS, check what it knows about a user, and turn it off.

DefenseClaw ties each agent action to the person who ran it and to the agent that did it. Guardrail profiles can then give a group, a user, a connector or a single agent its own policy, and every decision records which profile applied.

Identity-based sandboxes and guardrails (about 17 minutes). Active Directory users run Claude Code and Codex in OpenShell sandboxes with defenseclaw sandbox run. The guardrail profile of each user's AD group decides what the sandbox may reach: with one profile the agent clones from github.com and installs packages while a request to pastebin.com is refused, and a stricter profile refuses github.com too. A Grafana dashboard then shows the blocked requests by rule.

Attribution, not authentication

DefenseClaw reads identity only from the operating system the agent runs on.

  • It never calls an identity provider (no Entra, Okta or LDAP API calls).
  • It holds no identity credentials: no passwords, tokens, tickets or keys.
  • It adds no new secrets and no sign-in step.
  • Okta and Entra ID appear only through what the OS already knows: a joined device, Platform SSO, or a directory synced into AD or LDAP.

Each fact has an assurance level, sent as defenseclaw.user.principal.assurance:

AssuranceMeaning
verifiedThe gateway or the root guardian resolved it from how it authenticated the caller (kernel peer credentials or a per-user credential).
claimedThe hook reported it from the user's own session, which the user could change.

What is read on each OS is in How DefenseClaw knows who a user is.

Do not grant access from these fields

Identity in DefenseClaw records answers "who ran this agent". It is not an authenticated assertion for another system. Only verified facts can select a guardrail profile; headers, hook payloads and claimed facts never do.

Supported identity types

Per-user is the OSS install in the user's own home. Enterprise is the standalone enterprise profile with its root guardian or SYSTEM enumerator. Everything in the table is verified unless it says claimed.

IdentityLinuxWindowsmacOS
Local accountuid, name and groups from NSS filesSID and name from LookupAccountSiduid, name and groups from Open Directory, directory local
LDAP or SSSDAccount, domain, groups and the directory type of the joined realm, also per-user. Enterprise adds the UPN from SSSD InfoPipeNot applicableThe directory of an LDAP-bound account from dscl /Search (enterprise)
Active Directory over KerberosSSSD or winbind: principal, domain and groups. Without InfoPipe the principal is account@realm. The ticket cache's Kerberos principal is claimedAccount, domain and the AD UPN. Groups from the sign-in token (enterprise only): a domain group applies only while the user has a desktop session (Windows groups). The logon session's UPN and Kerberos principal are claimedAD-bound Mac: the Kerberos principal and domain (enterprise). The session's Kerberos principal is claimed
Entra ID (Preview)aad NSS module or Himmelblau: directory entra_id with the UPN, also per-user. Himmelblau gives Entra groups; aad does not. Entra Domain Services gives an AD accountEntra-joined or hybrid-joined: UPN, provider and tenant, also per-user. Entra group SIDs only for groups a built-in local group lists (enterprise only)Platform SSO with Company Portal: directory entra_id and the login UPN (enterprise). No Entra groups
Okta (Preview)Okta LDAP Interface and SSSD: uid, name and Okta groups, also per-user. Enterprise adds directory ldapAs the AD account Okta syncs toPlatform SSO or Okta Device Access with Okta Verify: SSO provider and login UPN (enterprise)

Setup guides: Active Directory on Linux, Microsoft Entra ID, Okta on Linux.

What differs between installs and platforms:

  • Linux per-user and enterprise. Both resolve the account, domain, groups and directory type. Only enterprise reads the UPN from InfoPipe, so a per-user SSSD principal is account@realm.
  • Windows per-user. It resolves the account, the AD UPN and the Entra UPN and tenant, but has no group list. Only users, connectors and agents assignments can match there.
  • macOS per-user. It reports the account and its groups with directory local. A bound Mac's directory, domain and SSO provider need the enterprise root enumerator.
  • Kerberos ticket location on Linux. RHEL 9 keeps the ticket in a KCM: cache. Ubuntu 24.04 keeps a delegated ticket in a FILE: cache named by KRB5CCNAME. DefenseClaw reads the default principal from either and never runs klist.
  • Okta is never an Okta lookup. On Linux and Windows an Okta user is the AD or LDAP account the OS gets from Okta. The directory value okta comes only from a Mac's Platform SSO or Okta Device Access provider.

Agent identity

Each agent gets an identity of its own, not only the person's. The identities are digests of facts the gateway already holds, so they need no credential and stay the same across sessions and gateway restarts.

LevelAttributeHow the ID is made
Personuser.id, defenseclaw.user.principalFrom the OS
Agentdefenseclaw.agent.identity.idagt- plus 16 hex digits of a SHA-256 over the machine ID, the verified user, the connector and its config root in the user's home
Sessiondefenseclaw.agent.instance_idais- plus 16 hex digits over the agent ID and the session ID
Sub-agentdefenseclaw.agent.instance_idais- over the parent instance and the sub-agent ID. It shares its parent's agt-

List the identities the gateway has seen, most recently seen first:

defenseclaw agent identities
defenseclaw agent identities --user alice --connector codex --json
User                    Connector  Agent identity        Sessions  Last seen  Config root
alice@corp.example.com  codex      agt-3f9c0a1b2c3d4e5f  4         2m ago     /home/alice@corp.example.com/.codex

--limit N lists only the N most recent and says on stderr how many there are in all. The gateway API returns 1000 identities a page (limit and cursor). The TUI Agents tab shows the 1000 most recent as Agents (1000+).

Agent identity rules

Sandboxed agents

An agent that runs in an OpenShell sandbox is attributed like a host agent, with four differences.

  • The user is the host user on the sandbox binding, the account that started the sandbox. The binding is attribution, not proof of the calling process, so it supplies no verified directory facts or groups. A request whose assignment needs a fact no other verified record supplies is refused and names that fact. Otherwise a proven connector-only assignment or the default profile applies. Identity headers the sandbox sends are ignored.
  • Each sandbox has its own agt-. A project run in two sandboxes is two agents. defenseclaw agent identities lists one per sandbox, and they stay listed after the sandbox is gone.
  • Its hooks enforce unless the profile says observe. A sandbox's hooks run in action mode whatever guardrail.mode says. A mode the person's own guardrail profile sets (mode, or connectors.<agent>.mode) applies in their managed sandboxes as on their host. Agent Substrate actors always enforce (Agent Substrate: managed enterprise).
  • Its web egress follows the sandbox's network profile (open, balanced or strict) and its policy pack, not a guardrail profile (Network and egress).

Check what DefenseClaw knows about a user

Ask the gateway how it resolves a user, the same way it does for a live request. --user takes the account name as getent passwd or id shows it, a uid or a SID, in any case.

defenseclaw guardrail profile explain --user alice@corp.example.com --json | jq .subject
defenseclaw agent identities --user alice
defenseclaw agent ide-plugins --user alice --ai-only

A per-user install explains only the account that runs it. --user with another account is refused (lookup_error, exit 1) before any lookup. A per-user gateway run as root explains every account.

Run as root. The package does not put defenseclaw-gateway on root's PATH, so use the full path:

sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise linux profile-explain --user alice@corp.example.com --connector codex
sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise linux agent-identities --user alice@corp.example.com
sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise linux ide-plugins --user alice@corp.example.com --ai-only
sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway enterprise macos profile-explain --user alice --connector codex
sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway enterprise macos agent-identities --user alice
sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway enterprise macos ide-plugins --user alice --ai-only

From an elevated PowerShell prompt, or as LocalSystem from an MDM script:

& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' enterprise windows profile-explain --user CORP\alice --connector codex
& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' enterprise windows agent-identities
& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' enterprise windows ide-plugins --user alice

On a managed install, defenseclaw runs only the commands in Managed command availability. A standard user on managed Linux or macOS can run defenseclaw guardrail profile explain for their own account; another account's profile stays an administrator view.

What the answers contain:

  • subject shows the user ID, the principal, the UPN and the groups.
  • profile-explain also lists every configured profile with its digest under profiles, in place of profile list and profile show.
  • Each agent-identities row carries the same fields on every OS, including the account's upn when its current verified facts hold one, and subagents_seen and last_subagent_id.
  • Each hook replaces the row's UPN. An expired or failed directory answer, or a UPN kept through an outage, leaves upn out of the row; profile matching still uses that last good UPN.
  • A cold Windows Active Directory lookup may leave upn out of the first row; it appears only if another hook runs after the directory cache has a current UPN. The row changes only when the agent hooks again.
  • After an account is deleted, agent-identities --user still finds its identities by name, uid or SID.

For fleet-wide views, use the Grafana Identity & Users board. Sandboxes users registered are listed with enterprise linux|macos sandbox list (Sandboxes on managed computers).

Refresh a managed macOS account

enterprise macos profile-explain refreshes the named account's cached identity facts when its lookup succeeds, so its hooks use the explained profile from their next call. Its JSON output shows the resolved subject and groups. Open Directory keeps its own membership cache. After a directory group change, flush it, then explain the account again:

sudo dscacheutil -flushcache; sudo dsmemberutil flushcache
sudo /opt/cisco/defenseclaw/bin/defenseclaw-gateway enterprise macos profile-explain --user alice

After a directory outage the guardian flushes these caches itself once the directory answers.

Refresh every account now

To apply a directory change to every cached account without waiting up to 15 minutes, run as root (Windows: elevated, or as SYSTEM):

sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise identity refresh --flush-os-cache --json
  • changes[] lists each account whose profile changed, with the old and the new profile. Its hooks use the new one from their next call.
  • --user alice refreshes one account; on Linux it then flushes only that account from SSSD.
  • Managed macOS hooks already ask Open Directory on each call. There the command reports the changes and, without --user, flushes the Open Directory caches.
  • On Windows, signed-in accounts keep their sign-in groups until they sign in again. They are listed in windows_token_groups_pending.

See enterprise identity refresh.

Turn off the principal or the IDE inventory

Two settings decide how much personal data leaves the host.

SettingDefaultEffect
ai_discovery.include_user_principalfalseAdds defenseclaw.user.principal and defenseclaw.session.kerberos_principal to every record that carries identity. Off by default, like include_user_email, because a principal names a person across systems.
ai_discovery.ide_inventoryallall, ai_only or off. ai_only keeps only AI plugins; off collects no IDE inventory.
~/.defenseclaw/config.yaml
config_version: 9
ai_discovery:
  include_user_principal: false   # the default; true sends the principal
  ide_inventory: ai_only          # all | ai_only | off

On a per-user install, check the file with defenseclaw config validate; the running gateway reloads it. On a managed host, change the machine configuration and apply it with ensure (Change the config). To validate the installed file on managed Windows, from an elevated PowerShell:

& 'C:\Program Files\Cisco\DefenseClaw\bin\defenseclaw.exe' config validate --config 'C:\ProgramData\Cisco\DefenseClaw\etc\config.yaml' --json

What stays on

While the setting is off, the projected principal and kerberos_principal values are null in the audit export. These stay on in either case, with no separate switch: user.id, the account name, the domain, the directory type, the assurance, the session kind and the client address. Choose destinations accordingly.

  • The principal, the Kerberos principal, the client address and the tenant ID are marked sensitive. The strict redaction profile, and a custom profile that extends it, removes them; none, sensitive and content keep them (Redaction).
  • A home-directory path can still contain the UPN on SSSD hosts with fully qualified names (End-user identity).
  • The identity.observed record carries a group count, never group names.

The IDE plugin inventory is part of AI discovery (IDE plugin inventory).

Troubleshooting

Identity problems and their fixes, for every directory, are in Troubleshooting: Identity.

Next steps