Overview
This guide shows how to create and evaluate Ad Hoc Rules in Sift using the REST API. Ad Hoc Rules are ideal for automated workflows, such as CI/CD pipelines, where Rules need to be defined, updated, and evaluated programmatically. The guide covers how to create Ad Hoc Rules via the BatchUpdateRules endpoint, preview their behavior using EvaluateRulesPreview, and run evaluations that generate Annotations and Reports using EvaluateRules. Use this guide when you need to automate Rule creation and execution outside the Sift web application, and want to integrate telemetry-based validation directly into your development or testing pipelines.NoteThis guide uses the Sift REST API for all examples. The same functionality is also available through the gRPC API, which supports official client libraries in Python, Go, and Rust.
- For full message schemas and service definitions, see gRPC API.
- For client installation details (Python, Go, Rust), see Quickstart: Connect to the gRPC API with an official Sift client.
Instructions
Step 1: Create an Ad Hoc Rule
To create an Ad Hoc Rule, use the BatchUpdateRules endpoint and set theisExternal flag to true. This enables a Rule to be created and evaluated ad hoc and simultaneously, which is ideal for a Rule triggered by CI/CD workflows.
NoteOnce an Ad Hoc Rule is created, it cannot be edited through the UI or API. Only non-Ad Hoc Rules can be modified.