Running the Semantic Guardrails samples

Instructions for running the Semantic Guardrails samples.

The example scripts under the semantic-guardrail/ folder demonstrate the usage of Semantic Guardrails APIs. For more information about the Semantic Guardrails APIs, refer to the section Semantic Guardrails APIs.

Note: A dedicated semantic-guardrail/docker-compose.yml is provided to start the Data Discovery and the Semantic Guardrails services.

  1. Open a command prompt.

  2. Navigate to the directory where AI Developer Edition is cloned.

  3. Run the following command to test Semantic Guardrails using Python scripts. The following command submits a multi-turn conversation for analysis. One for semantic and a second one for PII processing.

    python semantic-guardrail/samples/python/sample-guardrail-python.py
    
  4. Run the following command to start Jupyter Lab for running Semantic Guardrails.

    jupyter lab
    
  5. Copy the URL displayed and navigate to the site from a web browser. Ensure that localhost is replaced with the IP address of the system where the AI Developer Edition is set up.

  6. In the left pane of the Jupyter Lab, navigate to semantic-guardrail/samples/python/sample-app-semantic-guardrails.

  7. Open the Sample Application.ipynb file.

  8. Click the Play icon and follow the prompts in the Jupyter Lab.


Last modified : June 12, 2026