Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.egisai.co/llms.txt

Use this file to discover all available pages before exploring further.

egisai.shutdown() -> None
Stop background workers (live updates and audit delivery), close the underlying HTTP client, and flush any pending events. Idempotent.

When to use it

You usually don’t have to call shutdown() explicitly — egisai.init() registers it with atexit so it runs at process exit. Call it manually if:
  • Your process orchestrator terminates without firing atexit handlers (some containers do this on SIGKILL-like signals).
  • You want to deactivate the SDK in the middle of a long-running process — for example in a unit test, or before reinitializing with new credentials.

Parameters

None.

Returns

None.

Behavior

  • Stops the policy refresher worker if running.
  • Stops the audit logger worker if running, draining its queue first.
  • Closes the HTTP client used to talk to the control plane.
  • Releases any cached judge-side resources.
  • Safe to call multiple times — each subsequent call is a no-op.
shutdown() does not undo the import-time patches applied to provider SDKs. To resume governance after a shutdown(), call egisai.init() again.

Example

import egisai

egisai.init(api_key="…", app="my-bot")
try:
    run_application()
finally:
    egisai.shutdown()

What’s next

init

Activate the SDK.

Troubleshooting

What to check when something looks off at shutdown.