Loop icon
Download icon
Get icon
Script icon
If icon
ChatCompletion icon
GoogleGemini icon
SlackIncomingWebhook icon
Log icon
Set icon
Schedule icon
Webhook icon

Watch Vendor Terms and Privacy Policies with an AI Change Assessment

Detect changes to vendor terms and privacy policies, assess materiality with Gemini and alert Slack only when a change affects you.

Categories
AIBusiness

Vendors update their terms of service and privacy policies regularly, often with a short notice email that nobody reads. Some updates matter: new rights to train AI on your data, new data locations, price changes or reduced liability. This blueprint watches a list of public policy pages, computes the exact text diff each week, and asks Gemini whether the change is material for your company.

How it works

For each page in pages (Loop, two at a time):

  1. fetch_page downloads the page.
  2. load_previous reads the text saved last time from the Kestra KV store.
  3. compare_text extracts the readable text of the main content with the Python standard library and builds a unified diff. The first run is a baseline.
  4. if_changed skips the LLM when nothing changed.
  5. assess_change sends the diff and your company context to Gemini and gets structured JSON back: material, impact, summary and action.
  6. if_material posts material changes to Slack and logs minor ones.
  7. save_text stores the current text for next time, after the alert.

The errors branch posts to Slack if a page cannot be fetched or parsed.

Prerequisites

  • A Google AI Studio API key for Gemini (the free tier is enough).
  • A Slack Incoming Webhook.
  • Policy pages that render their text server-side. Pages that need JavaScript produce an explicit error instead of an empty diff.

Secrets

  • GEMINI_API_KEY: Gemini API key used by assess_change.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook URL for alerts and failures.

In the open-source edition, secrets are environment variables on the Kestra container, prefixed with SECRET_ and base64-encoded. See how to manage secrets.

Inputs

  • pages (JSON): list of {"key", "name", "url"} objects. key names the KV entry (policy_watch_<key>) and must be unique.
  • company_context (STRING): how you use these vendors and what you care about.
  • model_name (STRING, default gemini-2.5-flash).

Quick start

  1. Add the two secrets and edit pages and company_context.
  2. Execute the flow once to store the baseline.
  3. To test the alert path, edit one KV entry policy_watch_<key> in the namespace KV store (remove a paragraph) and execute again.
  4. Enable the weekly trigger. Change the webhook key before using on_demand.

Outputs

  • {{ outputs.compare_text.vars.diff }}: the unified diff per page.
  • {{ outputs.assess_change.jsonOutput }}: the assessment per changed page.
  • KV entries policy_watch_<key>: the last saved text of every page.

This blueprint helps you notice changes. It is not legal advice; route material changes to your legal or procurement team.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.