Skip to main content

Add custom IDs to rego policies samples

When debugging Rego policies, using sample { ... } is very useful to test previous real inputs. However, sometimes the filtering capability in here (Example: sample { input.stack.id == “<stack_id>“ } ) is not enough to easily identify certain samples across time.

The unique identifier for “Sampled previous inputs” is a timestamp (Example: 2025-05-05 12:00:00), however, it would be very useful if some extra info in here could be set.

  1. I’d suggest adding some extra info in here by default, for instance the input.stack.name, input.push.branch (Push Policy), or others. This would provide some default QoL to quickly identify which sample you’re interested in instead of going one by one until you find the one you’re looking for.

  2. Additionally or alternatively, some sample_name output could be added to allow to the user the sampling name customization. For instance, “sample_name := input.stack.name“ would end up in a title like `2025-05-05 12:00:00 <my-stack-name>`.


Wdyt? This would improve debugging experience ( - frustration, - time consumption for debugging)

Workaround
Problem
Status: ⬆️ Gathering votes1 comment

Log in to comment and vote

Comments1

  • Black Breeze

    •

    May 9, 2025

    Thanks for this—you’re absolutely right that identifying the right sample can be frustrating right now, especially when timestamps and stack IDs aren’t enough to go on.

    What you’re asking for (adding metadata or custom sample names) would definitely improve that experience in small but meaningful ways. Internally, we’ve run into the same friction.

    That said, the current architecture limits how much we can enrich or label samples today. The good news is that we’re actively exploring a deeper rework of the sampling system. The goal isn’t just incremental QoL—but a much more powerful and intuitive way to work with past inputs, test logic, and debug policies faster.

    Your feedback reinforces that direction and helps us sharpen the edges of what needs to improve. We’ll keep you posted as that broader initiative evolves.