{% extends "base.html" %} {#- Settings → Policy. Expects: scope, scopes, effective (EffectivePolicy of the scope), global_policy, policy_file, layers (database rows), layer_text, presets, proposals, optional error, preview (EffectivePolicy after a change), widened, confirm, message. Writes are plain form posts from this page in a browser (cookie + CSRF). -#} {%- macro hidden_csrf() -%}{%- endmacro %} {%- macro values_table(pol) -%} {% for path, value, source in pol.flat() %} {% endfor %}
ValueSettingSet by
{{ path }}{{ value|tojson_compact }}{{ source }}
{%- endmacro %} {% block title %}Policy · relaybay{% endblock %} {% block crumbs %}/Settings/Policy{% endblock %} {% block content %}

Policy

{% with tab = "policy" %}{% include "_settings_tabs.html" %}{% endwith %}

What agents may do on each kind of environment, what the guard counts as a change and what counts as a secret. Layers, a later one winning: preset → config.toml → global file → project → environment; an environment's own level on Stands & access wins over all of them. The guard is a safety net, not a sandbox.

{% if message %}

{{ message }}

{% endif %} {% if error %}{% endif %} {% if confirm %}

Confirm

{{ confirm.message }}

{{ hidden_csrf() }} {% for name, value in confirm.fields %}{% endfor %}
Cancel
{% endif %} {% include "_policy_proposals.html" %}

Preset

{{ hidden_csrf() }}

default: local and test full, live read, guard warn · strict: test ask, live none, guard block · trusted: full everywhere, guard log (journal only), test secrets on local and test.

Effective policy

Layers: {% for layer in effective.layers %}{{ layer.name }}{% if layer.error %} ignored: {{ layer.error }}{% endif %}{% if not loop.last %} → {% endif %}{% endfor %}

{{ values_table(effective) }}

Edit the {{ scope }} layer

{% if scope == "global" %}

The file {{ policy_file.path }}{% if not policy_file.text %} does not exist yet{% endif %}. Edits to the file are picked up without a restart.{% if policy_file.error %}

{% else %}

Stored in the database. Empty removes the layer.

{% endif %}
{{ hidden_csrf() }}
{% if preview %}

Preview: the effective policy after this change

{% if widened %}

Widens agents' access on live: {{ widened|join(", ") }}. Saving asks for a confirmation.

{% else %}

Valid. Does not widen agents' access on live.

{% endif %} {{ values_table(preview) }} {% endif %}

Project and environment layers

{% if layers %} {% else %}

None yet. Pick a project or environment above to add one.

{% endif %}
{% endblock %}