# Demo using UI

[Step by Step](#step-by-step)

[Demo Video](#demo-video)

## Step By Step

## 1. Import-Time Configuration

When importing a policy (via file or message), users can enable tamper-resistance by selecting a dedicated “Track policy changes” checkbox during the import process.

Once enabled:

* The system captures and stores the original state of the policy
* All future modifications can be compared against this original baseline

{% hint style="danger" %}
If the checkbox is not selected, the policy will behave as a standard imported policy with no tamper-tracking enabled.
{% endhint %}

<figure><img src="/files/cz6i0CD9HbAxXibwMnUc" alt=""><figcaption></figcaption></figure>

## 2. Data Model Enhancements

When tamper-resistance is enabled, the following additional fields are stored in the database to preserve the original policy state:

* originalChanged – Indicates whether the policy has diverged from its original state
* originalHash – Cryptographic hash of the original policy
* originalZipId – Reference to the stored original policy file
* originalMessageId – Reference to the original message (for message-based imports)

#### File-Based Import Behavior

* The original policy file is securely stored in the database
* A unique file ID is assigned and linked to the policy
* This file acts as the immutable baseline for all future comparisons

## 3. UI Enhancements

### 3.1 Policies Grid – Modified Column

A new “Modified” column is added to the Policies grid to surface tamper status at a glance.

Possible States

* Compare – The policy has been modified and can be compared with the original version
* No Changes – The policy matches its original imported state
* Status Unavailable – Original state is not available (e.g., tracking was not enabled)

<figure><img src="/files/ZuUHcsDk190N8KEvsr5x" alt=""><figcaption></figcaption></figure>

### 3.2 Compare Action

* Clicking **Compare** opens a detailed diff view
* Users can visually inspect differences between:
  * Original imported policy
  * Current policy state

This helps users quickly understand *what* changed and *where*.

<figure><img src="/files/8EQgCfeuDfWJ8j76wYqd" alt=""><figcaption></figcaption></figure>

## 4. Indexer

The functionality for displaying policy origin, and relationships between original and derived policies has also been implemented in the Indexer.

In the policy description, new states related to this functionality are available: the Original tab is visible, the Derivations tab is visible, or no additional tab is displayed

<figure><img src="/files/wJKiHRFDoBVQzpJQap1x" alt=""><figcaption></figcaption></figure>

When the Origin tab is displayed, it means that information about the parent policy is available, allowing the user to check for any differences from the parent policy

<figure><img src="/files/vLWDnZIQ760ISEJpsx7Q" alt=""><figcaption></figcaption></figure>

The comparison functionality remains consistent with the Guardian one, providing multiple comparison options, while the UI design has been updated

Once a policy has been used to create other policies, the Derivations tab is displayed

<figure><img src="/files/IMPyz0ROK1k5HryBwl9v" alt=""><figcaption></figcaption></figure>

The Derivations tab contains a table with all derivations of the current policy

<figure><img src="/files/9ZGoYpXiLxSXq1aSb6QR" alt=""><figcaption></figcaption></figure>

## Demo Video

[Youtube](https://youtu.be/kEQ5V1aMFQ4)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guardian.hedera.com/guardian-dev/guardian/standard-registry/policies/tamper-resistant-policy/demo-using-ui.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
