Skip to main content

Settings and managed settings

Scope: ServerRpc (server-wide operations tied to the Client) For an overview of RPC and the list of all RPC pages, see RPC.

contentExclusion

You can validate content exclusion policy JSON before creating a session.
policiesJson is passed to the CLI as an unparsed JSON string. If JSON parsing or schema validation fails, the CLI raises an RPC error (JsonRpcException). This is a server-scoped RPC that validates the policies themselves. To check paths in the session’s working directory against the actual exclusion policies, use the session-scoped contentExclusion()->checkPaths().

managedSettings (experimental: managed settings)

Read managed settings, resolve policies, get the schema, validate, preview composition, and clear the cache.

settings (experimental: settings file operations)

Remove a specific key from a settings file and redact secret values for display. removeRawKey() removes keys as-is, including keys that aren’t canonical settings paths, such as keys that failed to load. If the file can’t be parsed, the CLI doesn’t overwrite it and status is invalid. redactValueForDisplay() replaces secret values with placeholders based on the position in the settings tree given by basePath, so you can safely show the value to users or write it to logs.

providersConfig (experimental: provider configuration)

providersConfig()->addModel() is an experimental RPC that adds a model to the server’s saved provider configuration. If the provider isn’t saved yet, the CLI creates it, and providerAdded tells you so. The change is persistent, but it doesn’t modify running sessions.
You can pass a ProvidersConfigAddModelRequest instead of an array. The CLI stores the optional credential in the OS keychain and never returns it in the result. The same providersConfig() group reads, updates, and removes the saved configuration. These are also experimental APIs, and they don’t modify running sessions.
read() returns the configuration in saved order, without secrets such as credentials, headers, or commands. Each provider’s credentialStatus is present, absent, or unavailable. updateProvider() replaces the shared settings and keeps any credential, custom headers, and local model settings you omit. updateModel() replaces the model definition for the given provider name and model ID. When removeModel() removes the last model of a provider, it also removes the provider and its managed credential, and providerRemoved is true. Each update and removal also accepts the matching ProvidersConfigUpdateProviderRequest, ProvidersConfigUpdateModelRequest, or ProvidersConfigRemoveModelRequest.
Last modified on November 19, 2026