Enforce SMB file permissions
An SMB source records who can read each file on the file server. When you turn on Enforce source permissions, the endpoint only returns a file to users whose own account, or one of their groups, can read it on the file server. Everyone else can't find it in search, file lists or chat.
Enforcement is off by default. S3 and Azure sources aren't affected.
Before you begin
- An SMB source, or the details to create one.
- An Active Directory domain controller reachable from the platform over LDAPS (port 636 by default), and the PEM certificate chain that verifies its certificate.
- An Active Directory account that can read users' group membership, for example
[email protected]. - Your platform administrator has set up sign-in to pass each user's Windows security identifier (SID). See Set up user SIDs.
Turn on enforcement
When you add the source, or later when you edit it:
- Select Enforce source permissions.
- In Active Directory URL, enter the LDAPS address of a domain controller. It must start with
ldaps://, for exampleldaps://ad.example.com:636. - In Active Directory CA certificate, paste the PEM certificate chain, starting with
-----BEGIN CERTIFICATE-----. - If you're adding the source or rotating credentials, enter the SMB account in Username, Password and Domain (optional), or copy it from another source.
- In Active Directory bind username and Active Directory bind password, enter the account that reads
group membership, for example
[email protected]. Copied credentials include it, so these fields don't appear.
The source's details then show Source permissions: Enforced, with the Active Directory URL.
Edit an enforcing source
What you need to enter depends on what you change:
- You enter or change the Active Directory URL or CA certificate. The portal selects Rotate credentials and keeps it selected. Enter the SMB account again, and the bind account if enforcement is on.
- You turn enforcement off. There's nothing else to enter. The source keeps its URL, certificate and accounts for later.
- You turn enforcement back on with the same URL and certificate. There's nothing else to enter: the source reuses its stored accounts. If the save fails with Enforced SMB sources require LDAP bind credentials., no bind account is stored. Select Rotate credentials and enter both accounts.
Only a new or changed URL or certificate makes you enter credentials again.
What users can read
With enforcement on, a user can read a file only if their SID, or one of their Active Directory groups, can read it on the file server. This applies to everyone, including endpoint administrators, in search, file lists, document and chunk reads, groups and MCP tools.
- Everyone and Authenticated Users include every directory user, so files they can read are open to all of them.
- Built-in Windows groups (
BUILTIN\...) and groups local to the file server are ignored, because their members differ per machine. Grant read access to a domain user or group instead. - Users anywhere in the directory count, with no organizational unit or base DN limit.
- Users not found in the directory or without a valid SID, personal API keys without a stored SID and service account API keys can't read protected files. Their access to other files is unchanged.
- Group changes in Active Directory take up to five minutes to apply.
- If the directory can't be reached, requests that need it fail with
503instead of showing every file. A request filtered to one source or document skips the lookups for other sources.
What the portal shows
The File access column on the Data sources table and the RAG Endpoints list shows Restricted for a source that enforces permissions and Open otherwise. An endpoint is Restricted if any of its sources is. On the Data sources table, — means the source is deleted or its files are being deleted. On the RAG Endpoints list, — means the portal couldn't load that endpoint's data sources.
Uploaded files lists only the files you can access. It says Restricted sources show only files you can access., and shows No files you can access. when there are none. The Uploaded files button shows the number of indexed files next to its label. For a restricted source it shows no number.
When a file can't be indexed
Before downloading a new or changed file, the endpoint reads its permissions, even with enforcement off.
It indexes the file only if they give a plain list of who can read it. Otherwise the file fails with
unsupported_acl, and the sync finishes with errors. That happens when the file has:
- no permission list, which would let everyone read it
- no entry that gives read access
- an entry that denies read access
- an entry type the endpoint doesn't support
An unsupported_acl file that was indexed before is removed if enforcement is on, until a later sync finds its
permissions supported. With enforcement off, it stays.
If the permissions can't be read at all, for example because the connection drops, the file fails but keeps its indexed copy and last known permissions. Permissions that are read are saved before the download, so if the download or indexing then fails, the old content stays with the new permissions.
Set up user SIDs
The endpoint matches each user by their Windows SID, which sign-in must supply. Your platform administrator
configures the identity provider to add the user's SID to the Keycloak onprem_sid claim. LDAP federation can
supply it as base64-encoded binary, and Entra ID brokering in the S-1-... form. Both work.
A personal API key keeps the SID its owner had when the key was created. If the owner's SID changes or is removed, existing keys keep the old one, so revoke them.
Configure it through the API
To set enforcement through the manager API, or to see where each file's permissions are stored, see Documents protected by source permissions.
Fix a configuration error
A missing bind account or invalid Active Directory settings show as Configuration error. See Fix a configuration error.
Delete an enforcing source
Keep Delete indexed files selected. Files you keep lose their permissions, so anyone who can read the endpoint can read them. See Delete a source.