+
+Credential files need Smallstep Agent 0.72.0 or later, and API version `2026-11-01`.
+Older agents don't apply most of these settings; update the agent before you use them.
+
+
+
+## How it works
+
+A credential's `files` object holds one block per platform: `linux`, `macos`, and `windows`.
+Each device receives only the block for its own operating system.
+Inside a block, the `key`, `certificate`, and `root` entries each take their own path and permissions.
+
+Every field is optional.
+A platform without a block, or a file without an entry, keeps the agent's default path and permissions.
+
+## PostgreSQL on Linux
+
+PostgreSQL refuses to start when its key is readable by anyone but its own account.
+This credential writes the key for `postgres` alone, the certificate chain readable to all, and the root CA readable to a `monitoring` group:
+
+```bash
+curl -X POST https://gateway.smallstep.com/api/credentials \
+ -H "Authorization: Bearer $SMALLSTEP_API_TOKEN" \
+ -H "X-Smallstep-Api-Version: 2026-11-01" \
+ -H "Content-Type: application/json" \
+ -d @postgres-credential.json
+```
+
+```json
+{
+ "slug": "postgres-server",
+ "certificate": {
+ "type": "X509",
+ "authorityID": "3c2e1115-49b7-4657-9b0f-301d7111bc6e",
+ "duration": "24h0m0s",
+ "fields": { "commonName": { "static": "db.example.internal" } }
+ },
+ "key": { "type": "ECDSA_P256", "protection": "NONE", "store": "MACHINE" },
+ "policy": { "operatingSystem": ["Linux"] },
+ "files": {
+ "linux": {
+ "key": {
+ "path": "/var/lib/postgresql/16/main/server.key",
+ "format": "PKCS8",
+ "owner": "postgres", "group": "postgres", "mode": "0600"
+ },
+ "certificate": {
+ "path": "/var/lib/postgresql/16/main/server.crt",
+ "contents": "CHAIN",
+ "owner": "postgres", "group": "postgres", "mode": "0644"
+ },
+ "root": {
+ "path": "/var/lib/postgresql/16/main/root.crt",
+ "mode": "0640",
+ "acl": [{ "type": "GROUP", "name": "monitoring", "access": "r" }]
+ }
+ }
+ }
+}
+```
+
+## A service account on Windows
+
+On Windows, each file takes an access list of principals instead of an owner and mode.
+This credential lets the `CORP\svc-sql` domain account read the key, and nobody else besides `SYSTEM` and the Administrators:
+
+```json
+{
+ "slug": "sql-server",
+ "certificate": { "type": "X509", "authorityID": "3c2e1115-49b7-4657-9b0f-301d7111bc6e", "fields": { "commonName": { "static": "sql.example.internal" } } },
+ "key": { "type": "ECDSA_P256", "protection": "NONE", "store": "MACHINE" },
+ "policy": { "operatingSystem": ["Windows"] },
+ "files": {
+ "windows": {
+ "key": {
+ "path": "D:\\certs\\sql\\server.key",
+ "acl": {
+ "inherit": false,
+ "entries": [{ "principal": "CORP\\svc-sql", "access": "READ" }]
+ }
+ },
+ "certificate": { "path": "D:\\certs\\sql\\server.crt" },
+ "root": { "path": "D:\\certs\\sql\\root.crt" }
+ }
+ }
+}
+```
+
+A principal can be a local or domain account or group, a virtual service account such as `NT SERVICE\MSSQLSERVER`, a group managed service account such as `CORP\gmsa-sql$`, or a SID string such as `S-1-5-21-…`.
+
+By default, a Windows credential with a software key in the machine scope is also imported into the Windows key store and `LocalMachine\My`, next to its files.
+Set `"windowsStore": false` on the `key` to keep it to its files alone, for software that reads the files and shouldn't find the credential in the stores.
+It requires `"protection": "NONE"` and `"store": "MACHINE"`.
+
+## Field reference
+
+| Field | Applies to | Values | Default |
+| --- | --- | --- | --- |
+| `path` | key, certificate, root | Absolute path in the platform's style | The agent's directory for the credential |
+| `format` | key | `DEFAULT`, `PKCS8`, `CLASSIC`, `TSS2` | `DEFAULT` |
+| `contents` | certificate | `CHAIN` (leaf and intermediates) or `LEAF` | `CHAIN` |
+| `owner`, `group` | Linux, macOS | A name or a numeric ID, as a string | The agent's user and group |
+| `mode` | Linux, macOS | Octal string, `"0000"` to `"0777"` | `"0640"`; `"0600"` for SSH user credentials |
+| `acl` | Linux, macOS | List of `{type: USER or GROUP, name, access}`, `access` a combination of `r`, `w`, `x` | No extra entries |
+| `acl.inherit` | Windows | `true` keeps the access the folder grants | `false` once `acl` is set |
+| `acl.entries` | Windows | List of `{principal, access}`, `access` one of `READ`, `MODIFY`, `FULL_CONTROL` | See [Windows defaults](#windows-defaults) |
+| `key.windowsStore` | Windows | `false` keeps the credential out of the Windows stores | `true` |
+
+The root CA is always written to its own file and never into the certificate file.
+SSH credentials take `key` and `certificate` only.
+
+## Rules
+
+The API refuses a credential that breaks these rules, with an error that names the field:
+
+- **A custom key path needs a software key.** `key.path` is accepted only with `"protection": "NONE"` and without `key.pubFile`. The agent writes the key there and nowhere else.
+- **Paths are absolute** in the platform's style (`/…` on Linux and macOS, `C:\…` or `\\server\share\…` on Windows), and distinct within a block.
+- **Settings stay on their platform.** `owner`, `group`, and `mode` can't appear under `windows`, and a Windows access list can't appear under `linux` or `macos`. A block for an operating system the credential's `policy.operatingSystem` excludes is refused.
+- **`SYSTEM` keeps full control on Windows.** An access list that gives `SYSTEM` (`NT AUTHORITY\SYSTEM`, `S-1-5-18`) less than `FULL_CONTROL` is refused, and each principal can be listed once.
+
+The API doesn't check owners, groups, or principals: they exist only on the device.
+The agent reports a name it can't find when it writes the file.
+
+### Windows defaults
+
+- The key file always grants `SYSTEM` and `BUILTIN\Administrators` full control, with inheritance blocked; `acl.entries` add principals to that.
+ Listing the Administrators with `READ` or `MODIFY` lowers their access. They can't be removed.
+- The certificate and root files inherit their folder's permissions unless they have an `acl`. With one, `SYSTEM` gets full control in addition to the listed entries.
+- A virtual service account (`NT SERVICE\