Invoking Rulesets
You’ll need to invoke Protect whenever there’s an input or output you want to validate.
You might choose to run multiple validations on different stages of your workflow (e.g. once when you get the query from your user, another time once the model has generated a response for the given task).
Projects and Stages
Before invoking Protect, you need to create a project and a stage. This will be used to associate your invocations and organize them.
To create a new project:
And to create a new stage thereafter:
If you want to add a stage to a pre-existing project, please also specify the project ID alongwith your stage creation request:
Invocations
At invocation time, you can either pass the project ID and stage name or the stage ID directly. These can be set as environment variables or passed directly to the invoke
method as below.
For more information on how to define Rules and Actions, see Rules and Actions.
Was this page helpful?