Stage concepts
Stages are created in code against a project, then used in runtime protection by name or Id. Stages can have one of two types, central stages or local stages. You can provide the project name or project Id directly when creating a stage, or use theGALILEO_PROJECT
environment variable.
When you create a central stage, you need to provide a prioritized list of rulesets. The order of these rulesets determines the action that is returned, if any rulesets are triggered, the action from the first triggered ruleset in the list is returned.
Stages can be paused and resumed when required. When paused, the stage will always return success (with a status of paused) with no rulesets triggered.
Stages can also be versioned, with different versions having different rulesets. When you use a stage, you can specify the version to use.
Central stages
Central stages are designed to be created and managed by central AI governance or IT teams, and can be used by any application. When you create a central stage, you supply the rulesets at creation time. When these stages are updated, for example adding new rulesets, the version is incremented. The applications using these stages can then either use a stage with a fixed version, or use the latest version. Once a central stage has been created, it can be used in any application that uses the same Galileo project, using the stage Id or name.Local stages
Local stages are designed to be managed by application teams. These stages are created without rules, then when your application uses the stage, it supplies the ruleset at runtime. Local stages can be re-used between applications, but each application will need to provide the rulesets at runtime.Create stages
Stages need to be created before being used, but can be created at any time. For central stages, these can be created using scripts managed by central AI governance teams. For local stages, you can create these in your application code (checking to see if they exist first), or create manually using scripts or part of your deployment pipelines. See thecreate_protect_stage
Python SDK docs for more details.
Create a central stage
When you create a central stage, you need to provide the prioritized list of rulesets.Create a local stage
When you create a local stage, you don’t provide rulesets up front.Get stages
You can get a stage by name or Id.None
.
See the get_protect_stage
Python SDK docs for more details.
Update central stages
You can update the rulesets associated with a central stage. The stage can be updated to have a new ruleset, or you can clear the rules for a stage. When you update a stage, a new version is created.update_protect_stage
Python SDK docs for more details.
Pause and resume stages
Stages can be paused and resumed. This allows you to turn stages on and off without re-deploying your application.pause a stage
pause_protect_stage
Python SDK docs for more details.
Resume a stage
resume_protect_stage
Python SDK docs for more details.