How-to

Disable automatic enforcement

Applies to: .NET SDK, Node.js SDK Last updated: 2026-06-11

Goal

Stop the SDK from automatically applying policy rules on every encrypt and decrypt. Apply rules manually only on the messages you choose, or use an external authorisation system.

When to disable

Disable

client.DisableAutoEnforce();

After this call:

Re-enable

client.EnableAutoEnforce();

Check the current state

Console.WriteLine($"AutoEnforce: {client.AutoEnforceOnDecrypt}");

Apply rules manually when AutoEnforce is off

You can still authorise specific messages explicitly. See Manually authorize a message for details.

See also