The HiddenLayer SaaS endpoint lets you exercise the API and detections without needing to deploy a container or wire up a backend LLM. The same script also works against a locally-running Runtime Security container — just point
base_url at your container.
This content demonstrates using the HiddenLayer SDK and Python. There are other options.
- For other programming languages, like Typescript, see the HiddenLayer GitHub page.
- For the HiddenLayer API, see the Developer Portal (requires a login).
Pre-Requisites
To follow this tutorial, you need:- HiddenLayer AI Runtime Security license
- HiddenLayer ClientId and ClientSecret to generate an access token
- Python 3.9+
SDK Python
The following script shows you how to make a simple call to the HiddenLayer endpoint for Interactions. Copy the script, save it to your working drive, and replace any necessary variables with your values.-
Install the HiddenLayer SDK Python using PyPI. If you cannot use PyPI, you can download the SDK from the HiddenLayer SDK Python GitHub page.
-
Create a Python file.
Notes
Some notes on using this script:- Authentication and calling the endpoint are region-specific operations. Set
environment="prod-eu"if you are in the EU, or leave it as the default (prod-us) if you are in the US. - If there are multiple Python versions on your system, make sure you are using the version the HiddenLayer SDK is installed to.
- This script can also be run against a locally-running containerized instance of Runtime Security — set
base_urlto your container’s URL, e.g.http://localhost:8000.

