CHATBOTS

Auto-Expiry Sweep for Time-Boxed Warehouse Grants

A scheduled job that finds Snowflake grants whose access window has expired in the ledger, revokes them automatically.

CategoryChatbots
Enginesim
Difficultyintermediate
Triggerschedule
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerScheduled sweep fires (hourly)
  • ActionQuery ledger for grants past expires_atPostgreSQLPostgres
  • LogicExit if no grants are due for revocation
  • ActionExecute REVOKE for each expired grant in SnowflakeSnowflakeSnowflake
  • ActionMark ledger rows as revoked with timestampPostgreSQLPostgres
  • OutputPost revocation digest to governance Slack channelSlack

What it does

Enforces the expiry side of time-boxed access. Every grant in the audit ledger carries an `expires_at`; this job runs on a schedule, finds the ones that have lapsed, executes the matching `REVOKE` in Snowflake, marks the ledger row as revoked, and reports the sweep. No human has to remember to clean up temporary access.

When to use it

Use it alongside any self-serve grant flow where access is meant to be temporary. Without automatic revocation, "two-week" grants quietly become permanent and access reviews balloon. This keeps the live grant set matching the approved-and-still-valid set.

How it works

  1. 1A schedule fires the sweep (e.g. hourly).
  2. 2The job queries the Postgres ledger for active grants where `expires_at` is in the past.
  3. 3If none are due, it exits quietly.
  4. 4For each expired grant it runs the corresponding `REVOKE ... FROM ROLE` in Snowflake.
  5. 5It updates each ledger row to `revoked` with a timestamp and reason.
  6. 6It posts a digest of revoked grants (user, object, original approver) to the governance Slack channel.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect PostgresAny Postgres URL — query, write, migrate.
  2. 2
    Connect SnowflakeWarehouses, queries, shares.
  3. 3
    Connect SlackChannels, DMs, threads, mentions.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.