EnterpriseIdentity

How DefenseClaw knows who a user is

See how DefenseClaw learns who ran an agent from the operating system alone on Linux, Windows and macOS, what is verified or claimed, and the limits.

DefenseClaw ties each agent action to a person without integrating with your identity provider. It makes no directory API calls to Active Directory, Okta or Entra, and it needs no credentials, tokens, service accounts or app registrations. It reads what the operating system already knows about the account running the agent, and says how far each fact can be trusted.

This page is the reference for what is read, where, and how much to trust it. For the overview and the checks, see Identity and authentication.

Identity setupStatus
Local accounts on Linux, Windows and macOSSupported
Active Directory over Kerberos with SSSD on RHEL 9 and Ubuntu 24.04, per-user and managedSupported
Domain-joined Windows: the AD account and UPN on a per-user install; group-based profiles with local groups on a managed computerSupported
Domain-joined Windows on a managed computer: AD domain groups for profile assignmentSupported. A group applies only while the user has a desktop session (Windows groups)
AD-bound MacSupported
Okta: the Okta LDAP Interface on Linux, Platform SSO or Okta Device Access on macOSPreview
Microsoft Entra ID, every setupPreview

What it never does

  • It makes no identity-provider or directory API calls. A lookup is a call to the host's own account database (getent, SSSD, the Windows token and registry, Open Directory).
  • On a domain-bound Mac, the root guardian probes TCP port 389 on a domain controller to detect directory recovery. It sends no LDAP query and no credentials.
  • It holds no identity credentials: no passwords, tokens, tickets or keys. It records the Kerberos principal name, not the ticket contents. On macOS it may run /usr/bin/klist --json to read the default API cache.
  • It adds no sign-in step and changes no identity setting on the host.

Verified and claimed

Every fact has an assurance level, recorded as defenseclaw.user.principal.assurance.

AssuranceWho vouches for itUsed for
verifiedThe gateway took the uid or SID from how it authenticated the caller, never from anything the caller sent (see how). The gateway or the root enumerator then read the facts from the OS account database.Attribution, and selecting a guardrail profile
claimedThe hook, which runs as the user and can be changed by the user: the Kerberos principal in the ticket cache, the SSH variables, the Windows logon session.Attribution only. Never selects a profile
vouches
claims
verified only
records both
adds profile, reason
TrustedZ0 · Operating system (root)
RestrictedZ2 · Gateway (service or user)
UntrustedZ4 · User session (the user)
Caller proof, account datavouch for the uid or SID
Gatewayresolves the facts itself
Profile matcherverified facts only
Hookreports session facts
Audit recordassurance: verified or claimed

List view for small screens. Use the expand button to open the drawing.

TrustedZ0 · Operating system (root)

  1. Caller proof, account datavouch for the uid or SID
    • vouchesGatewayZ2

RestrictedZ2 · Gateway (service or user)

  1. Gatewayresolves the facts itself
    • verified onlyProfile matcher
    • records bothAudit record
  2. Profile matcherverified facts only
    • adds profile, reasonAudit record

UntrustedZ4 · User session (the user)

  1. Hookreports session facts
    • claimsGatewayZ2
  1. Audit recordassurance: verified or claimed
ConnectorGatewayPolicy layerData store
Two paths into one audit record. The way the gateway authenticated the caller and the account database vouch for the verified path. The hook runs as the user, so what it reports is claimed and never reaches the profile matcher.
Text version of this diagram

Trusted: Z0 · Operating system (root)

  • Caller proof, account data: vouch for the uid or SID (data store)
    • vouches to Gateway (Z2 · Gateway (service or user))

Restricted: Z2 · Gateway (service or user)

  • Gateway: resolves the facts itself (gateway)
    • verified only to Profile matcher
    • records both to Audit record
  • Profile matcher: verified facts only (policy layer)
    • adds profile, reason to Audit record

Untrusted: Z4 · User session (the user)

  • Hook: reports session facts (connector)
    • claims to Gateway (Z2 · Gateway (service or user))
  • Audit record: assurance: verified or claimed (data store)

A record carries verified facts whenever the gateway resolved some, and claimed facts fill in only what nothing verified. When the gateway resolved no directory facts at all, the record carries the principal the hook reported, with assurance claimed and source hook_reported. Profiles ignore such a record.

How the gateway learns who called

The gateway never takes the user from a request. It takes the uid or SID from how it authenticated the request, and the install decides how.

InstallHow the caller is authenticatedThe user the gateway takes
Per-user, any OSThe gateway, hook or ACP token in the user's own files. The gateway runs as that accountThe account the gateway runs as
Standalone enterprise, Linux and macOSThe kernel's peer credentials on the hook socket. On loopback TCP, a per-user credential accepted only from a process of the uid it is bound toThe peer's uid, or the uid the credential is bound to
Standalone enterprise, WindowsA per-user credential on loopback TCP (127.0.0.1:18970). Windows gives the gateway no kernel check of a TCP callerThe SID the credential is bound to
Sandbox of a per-user installThe sandbox binding's credential, which only that sandbox holdsThe host user recorded on the binding

A per-user credential is an HMAC-SHA256 of the connector and the uid or SID, under a per-machine key that no user holds. The hook guardian writes each enrolled user's credentials into that user's own hook files. The gateway reads the identity the presented credential is bound to, and refuses with 403 a request whose identity headers name anyone else.

On Windows the SID is therefore bound to a credential, not verified by the kernel. Another standard user cannot present it, because it is in the first user's files. A process of the same user, or an Administrator or SYSTEM that can read those files, can present it; the gateway cannot tell those callers from the user's own hook.

A per-user gateway takes its own account as the user of every request that authenticated. A request that proves nothing, such as a provider key alone on the LLM proxy, has no verified user. A gateway that runs as a service account, as every standalone enterprise install does, never falls back to its own account.

What each OS tells us and where we read it

Linux

What the OS knowsWhere DefenseClaw reads itAssurance
Which user made the requestEnterprise: kernel peer credentials, or the uid of a per-user credential. Per-user: the account the gateway runs asVerified
Account name and backendNSS (getent passwd). Each service on the passwd line of nsswitch.conf is asked for the uid in turn (sss, winbind, ldap, himmelblau, aad). An account no directory service knows, or one /etc/passwd holds under its name and uid, is localVerified
DomainSSSD: the joined domain that holds the account by its SID (When Linux attributes a principal). winbind: the domain its name reports, in lower case, with a NetBIOS domain reported by its realm's DNS name. nss_ldap (nslcd): noneVerified
Groupsinitgroups plus a group lookup through NSS. An SSSD account keeps only the groups of its SID's domain, its local groups and its primary groupVerified
Directory type and realmrealmd on the system bus (owner checked to be uid 0). active_directory for an AD realm, ldap for an IPA realm. Any account may read it, so per-user installs get it tooVerified
UPNSSSD InfoPipe, read by the root hook guardian (enterprise only). Without it the principal is account@realm. A winbind host has no InfoPipe and no UPN. An Entra account named by its UPN (aad, or Himmelblau with cn_name_mapping = false) reports that UPN on every installVerified
Directory type of a domain no realm coversInfoPipe's id provider for the domain: ldap or ipa gives ldap, ad gives active_directory (enterprise only)Verified
SSH or local sessionThe hook claims its logind session and terminal. The gateway confirms it with systemd-logind GetSession or /run/utmpVerified when confirmed, otherwise claimed
Kerberos principalThe default principal of a FILE:, DIR: or KCM credential cache. KEYRING: caches are reported by type onlyClaimed

Things to know on Linux:

  • Himmelblau groups. Himmelblau answers a group only by gid or Entra object ID, not by name, so DefenseClaw does not warn that a group is unknown on a host whose group line lists himmelblau.
  • Unnamed groups. An answer with a group that is only a number (a directory that did not answer for it) is kept 2 minutes instead of 15.
  • Bare users entries with several domains. With more than one joined AD domain or a listed child domain, the same entry selects the account of that name in each of those domains. The default and permissive policy tiers still match and warn, naming every account it selects. The strict policy tier refuses a request when that ambiguity could change its profile. Write the qualified principal, or the uid, to select one account.
  • A local uid that SSSD also holds. When passwd lists sss after files, only root can confirm that SSSD's "no such account" is final. On enterprise the root guardian checks each enrolled account. A per-user gateway takes its own groups from its kernel credentials (source process_credentials), and a users entry that names the account refuses with the account holder is unconfirmed. A users entry by uid ("1020") still matches.
  • What needs privilege. The NSS, SSSD SID and realmd lookups run on every install without privilege. Only the InfoPipe facts need the enterprise root guardian.

When Linux attributes a principal

SSSD serves Active Directory, IPA and plain LDAP domains side by side, and an account's name does not say which domain holds it. So DefenseClaw decides an SSSD account's domain from its uid. The gateway asks SSSD which SID it holds for the uid (sss_nss_getsidbyuid), which any account may do.

CaseResult
A joined domain (realmd, client sssd) holds a user of the account's name with the same SID, and SSSD maps the SID back to the same uidThe realm, its directory type and the principal account@realm
Fully qualified names (alice@corp.example.com, what realm join writes)Only the domain the name gives is asked: the joined domain, or a listed child domain
Short names (use_fully_qualified_names = False)Each joined domain and each listed child domain is asked
An account of a plain LDAP domain (no SID)No realm, principal or directory type from the joined domain, whatever its name
A name that only looks qualified, such as an LDAP bob@corp.example.com or CORP\bobNo domain, and no users entry selects it by name. Select it by uid
An account of another domain with its own SIDsNever the realm of an AD account it shares a name with

The SSSD domain must carry the joined domain's name, as realm join writes it ([domain/corp.example.com]), and keep the default AD or IPA name expression.

Groups. Two SSSD domains may hold the same short name. The gateway keeps the groups SSSD holds a SID for in the account's own domain (or the groups without a SID, for an account without one), plus the host's /etc/group groups and the primary group. /etc/group groups count only when nsswitch.conf lists files or compat on its initgroups line, or on group when there is no initgroups line. Two plain LDAP domains with the same short name are not told apart; give them fully qualified names.

Child domains of the joined realm

An account of a child domain of the joined realm, such as gail@emea.corp.example.com on a host joined to corp.example.com, is verified only when you list its domain in ai_discovery.trusted_ad_child_domains. Nothing a per-user gateway can ask proves that a domain below the joined one is a trusted child, so DefenseClaw fails closed.

ListResult for a child-domain account
Empty (the default)Only accounts of the joined domain are verified
Domain not listedThe account keeps its uid and name but gets no domain, realm, directory type or principal. Only groups, connectors or agents assignments, or the default profile, can select it
Domain listedWhen SSSD holds a user of that name with the account's SID in the listed domain, the account gets the domain, its realm (EMEA.CORP.EXAMPLE.COM), the joined realm's directory type and the principal gail@emea.corp.example.com

A listed domain that is not below a joined Active Directory realm trusts nothing.

config.yaml (the admin config on a managed host, ~/.defenseclaw/config.yaml per user)
ai_discovery:
  trusted_ad_child_domains:
    - emea.corp.example.com
    - apac.corp.example.com
  • Each entry is a DNS domain of at least two labels, compared without regard to case or a trailing dot.
  • Validation refuses a wildcard (*.corp.example.com), a NetBIOS name (EMEA), an account (alice@... or EMEA\alice) and a duplicate.
  • The gateway applies a changed list at reload; the guardian at its next pass.
  • List only domains your joined domain's controllers trust: a listed domain is trusted for every account SSSD holds in it.

On a managed Linux host, the administrator runs sudo /opt/defenseclaw/bin/defenseclaw-gateway config validate ./config.yaml; per-user installs use defenseclaw config validate (which commands a managed host runs).

On a managed Linux host, check an account as root:

sudo /opt/defenseclaw/bin/defenseclaw-gateway enterprise linux profile-explain --user gail@emea.corp.example.com --json
  • The per-user defenseclaw guardrail profile explain and defenseclaw config get commands refuse there. The configured list is in the administrator's /etc/defenseclaw/config.yaml.
  • For an account of an unlisted child domain, subject.directory and subject.principal are empty, and the text output shows the account name with no realm. The subject object has no domain field: subject.principal carries the realm of an account a listed or joined domain confirms.
  • A users assignment that names only a principal (alice@CORP.EXAMPLE.COM) matches only while the account has that principal. Add the uid when the account must match while SSSD does not answer.
  • profile-explain also names a sandbox refusal a hook call does not make: refused_paths lists sandbox, with sandbox_refused_reason and a warning.

Windows

What the OS knowsWhere DefenseClaw reads itAssurance
Which user made the requestEnterprise: the SID a per-user credential is bound to, over loopback TCP (not kernel-verified). Per-user: the account the gateway runs asVerified
Account name and domainLookupAccountSid. The domain is reported in lower caseVerified
AD UPNTranslateNameW. The first lookup waits up to 1.5 seconds when a users or groups assignment exists, otherwise it runs in the background. Cached 5 minutes. A failed lookup is retried after 2 minutes; the last good answer is kept during the outage for profile matching. Agent identity rows leave that kept UPN out until a lookup verifies one and the agent hooks againVerified
Entra UPN, provider and tenantHKLM\SOFTWARE\Microsoft\IdentityStore\Cache\<SID> and the CloudDomainJoin\JoinInfo join state, on Entra-joined and hybrid-joined computersVerified
GroupsThe SYSTEM enumerator's cache of each user's sign-in token groups: local and AD groups, and the Entra groups a built-in local group lists (Entra groups on Windows). Enterprise onlyVerified
Remote desktop, logon type, logon session UPN and Kerberos principalLsaGetLogonSessionData for the hook's own logon sessionClaimed
SSH sessionSSH_CONNECTIONClaimed

Windows groups follow the sign-in token:

  • A user added to or removed from a group gets a new token after signing out and back in. A new Entra group SID may also need dsregcmd /refreshprt and another sign-in.
  • After the sign-in the enumerator records the new groups. The next hook request, a few seconds later at most, uses the new profile.
  • Windows groups are known only while the user has a desktop session (console or Remote Desktop). An SSH, scheduled-task or runas session does not count.
  • For a user who is signed out or never signed in at the desktop, profile-explain --user shows group_count 0 and groups null: the groups are unknown, not empty. When a groups assignment exists, match is default_lookup_failed, unproven_facts lists groups:unknown, refused is true, and a warning names the cause (no active desktop session, or no identity record yet).

So a domain group applies only after the user signs in at the desktop. Until then, and again after they sign out, profile-explain refuses for a groups assignment and the strictest of the candidate profiles applies. To check a group assignment, explain the user while they are signed in at the desktop.

macOS

What the OS knowsWhere DefenseClaw reads itAssurance
Which user made the requestEnterprise: kernel peer credentials, or the uid of a per-user credential. Per-user: the account the gateway runs asVerified
Account name and groupsOpen Directory. Every install reports directory local and source macos_opendirectoryVerified
Kerberos principal and AD mobile accountdscl /Search AuthenticationAuthority (enterprise only)Verified
AD domaindsconfigad -show (enterprise only)Verified
Device SSO provider (Entra or Okta)app-sso platform -s: Microsoft Company Portal for Entra ID, an Okta Verify bundle for Okta (Preview; enterprise only)Verified
The user's Platform SSO loginAltSecurityIdentities of the account record (PlatformSSO:<upn>), which only privileged code can write. It becomes the account's UPN and principal; accounts that never registered stay local (enterprise only)Verified
Entra or Okta groups through Platform SSONone reach the macOS group databaseNone
Kerberos principal of the sessionThe default API: cache from /usr/bin/klist --json at most once per 5 minutes, or a FILE: cache named by KRB5CCNAME or krb5.confClaimed
SSH sessionSSH_CONNECTIONClaimed

When the Platform SSO listing fails or is slow, the account stays local. Then only a UPN or DOMAIN\name entry waits for the guardian's record; a bare name does not select it.

Which install resolves what

FactPer-user (OSS)Standalone enterprise
Account, name, uid or SIDGatewayGateway
Linux groups, domain, sourceGateway, through NSSGateway, through NSS
Linux directory type and realmGateway, through realmd and the SID of the uidThe same; the root guardian drops a realm when InfoPipe holds the uid in another SSSD domain
Linux UPN, and the directory type of a domain no realm coversOnly the UPN of an Entra account (aad, or Himmelblau with cn_name_mapping = false)Root guardian; the UPN of an Entra account from the gateway
Windows groupsNot availableSYSTEM enumerator
Windows AD UPN, Entra UPN and tenantGatewayGateway
macOS directory, domain, SSO provider and Platform SSO UPNNot availableRoot enumerator
Session and Kerberos principalHook, claimed (Linux SSH confirmed by the gateway)The same

How Okta and Entra users appear

DefenseClaw sees the accounts the OS sees, so the way an Okta or Entra user appears depends on how the directory reaches the machine. Okta and Entra ID are Preview. Setup steps are in Okta on Linux and Microsoft Entra ID.

Your setupWhat DefenseClaw reports
Okta or Entra provisions users into AD, and the machine is AD-joinedThe AD account: directory active_directory, the AD UPN, groups and domain
Okta LDAP Interface through SSSD (id_provider = ldap) or nss_ldapThe LDAP account: uid, name and Okta groups, also per-user. Directory ldap through nss_ldap, and through SSSD on enterprise. No domain unless SSSD uses fully qualified names; no UPN unless SSSD maps the Okta login to it
Mac with Platform SSO or Okta Device Access and Okta VerifyA registered account: directory okta, source macos_platform_sso, its login UPN (enterprise only)
Linux with an Okta agent that creates local accountsThe local account, directory local. No Okta NSS module is recognized
Entra-joined or hybrid-joined WindowsDirectory entra_id, source windows_identity_store, the UPN and the tenant ID. Entra group SIDs (S-1-12-1-...) only for groups a built-in local group lists, enterprise only
Mac with Platform SSO and Company PortalA registered account: directory entra_id, source macos_platform_sso, the UPN and its domain (enterprise only). No Entra groups
Linux with the aad NSS moduleDirectory entra_id, source nss_aad, the UPN and its domain. Only the account's private group, so no groups assignment can name an Entra group
Linux with HimmelblauDirectory entra_id, source himmelblau, the user's Entra groups by name. The UPN and domain only with cn_name_mapping = false
Linux joined to Microsoft Entra Domain ServicesThe AD account of the managed domain: directory active_directory, the synced Entra groups, the UPN through InfoPipe on enterprise

Entra groups on Windows

An Entra-joined computer puts an Entra group's SID into a user's sign-in token only when one of the built-in local groups lists that group: Administrators, Users, Guests, Power Users, Remote Desktop Users or Remote Management Users. Membership in any other Entra group never reaches the computer. A groups assignment, or an enrollment include_groups or exclude_groups entry, that names such a group matches no one.

Name the group by its SID; the computer cannot resolve an Entra group's name. The steps to read the SID and add it to the built-in Users group are in Entra ID on Windows.

Limits, stated plainly

  • Local accounts have no directory groups. A local account has only the groups its OS account database lists, no domain and no UPN.
  • Windows group naming is bounded. DefenseClaw names at most 128 groups per account within the two-second lookup budget. The rest stay as SIDs, so use the SID in a group assignment when needed.
  • Group changes take time. The gateway caches a user's directory facts for 15 minutes (2 minutes for an answer with an unnamed group, or an SSSD account still waiting for its UPN on enterprise). A Windows user must also sign out and in. Himmelblau and SSSD add their own caches.
  • A reused uid gets its own facts. On Linux and macOS a new account given a removed account's uid gets its own facts within 5 minutes, never the old holder's.
  • A first lookup can be slow. A cold SSSD or AD answer can take seconds; the first request waits up to two seconds. An assignment that needs the unanswered fact refuses the request until the lookup is retried; otherwise the proven match or the default applies.
  • Some facts need the enterprise profile. The Linux UPN, the Windows group list and the bound-Mac facts are read with privilege by the root guardian or enumerator.
  • The Kerberos principal and the session can be changed by the user. They are always claimed, except a Linux SSH session the gateway confirmed through logind or utmp.
  • Two plugins send no Kerberos principal. The OpenCode and Amp plugins run inside the agent process and do not read the ticket cache. Hooks that go through the DefenseClaw hook runner read it.

What a record carries

Every identity attribute is listed in End-user identity. The values of defenseclaw.user.identity.source are:

SourceOS facility
nss_files, sssd, sssd_infopipe, winbind, nss_ldapLinux NSS, SSSD and InfoPipe, winbind, nslcd
himmelblau, nss_aadLinux Entra ID modules
process_credentialsA per-user Linux gateway's own kernel credentials
windows_lsa, windows_identity_storeWindows LSA and the Entra identity store
macos_opendirectory, macos_platform_ssoOpen Directory and Platform SSO
hook_reportedOnly the hook's claim; profiles ignore it

A low-rate identity.observed record, once per user per cache lifetime, carries defenseclaw.user.group_count and never group names.

Next steps