Safety policy

What a provider can enforce in ReClash so that the user cannot undo it.

On this page

A policy has up to two parts. The rule sits in the subscription body as plain mihomo config, so every client honors it. The switch sits in the manifest's policy section and makes ReClash enforce the rule.

You wantSubscription bodyManifest
Global mode only through chosen nodesA GLOBAL group that lists themglobal: listed
No Global mode at allNothingglobal: off
Android apps always outside the VPNtun.exclude-packageapps: required
No local proxy ports on AndroidNothinglocal-ports: closed
No dashboard editingNothingdashboard: locked

Every key is optional. A key you leave out restricts nothing.

yaml
policy:
  global: listed       # any (default) | listed | off
  apps: required       # recommended (default) | required
  local-ports: closed  # open (default) | closed
  dashboard: locked    # editable (default) | locked

Only listed nodes in Global

Rule mode stays free: your rules decide. In Global mode, traffic may leave only through nodes reachable from the GLOBAL group.

The simplest form is mihomo's native filter. Say the fleet has nodes named Germany, Poland LTE, Russia LTE and Streaming, and Global mode may use only the LTE ones.

Subscription body:

yaml
proxy-groups:
  - name: GLOBAL
    type: select
    include-all-proxies: true
    filter: '\bLTE\b'
    remnawave: { include-proxies: false }

Manifest:

yaml
policy:
  global: listed

Result:

Mode and nodeResult
Rule mode, any node, Streaming includedWorks.
Global, Poland LTEWorks.
Global, Russia LTEWorks.
Global, GermanyBlocked. The app asks the user to pick an allowed node or use Rule mode.
Global, DIRECTBlocked. A denied route never falls back to a direct connection.

What to write:

You wantGLOBAL group
Nodes that carry a marker in the nameinclude-all-proxies: true and filter: '\bLTE\b'.
Everything except some nodesinclude-all-proxies: true and exclude-filter: Streaming.
An exact short listHand-listed proxies. A host the user lacks makes the config fail, see below.
  • filter matches node names only. It narrows only include-all-proxies (or include-all) members, never explicit proxies.

  • A backtick separates alternatives. (?i) ignores case.

  • Prefer \bLTE\b to lte: the unanchored lte also matches Malte.

  • exclude-filter and exclude-type remove members from every group, explicit proxies included.

  • The marker must be in the node name. Remnawave host tags do not reach the mihomo config.

  • New matching nodes join by themselves, and a user whose tariff lacks some matching hosts still gets a config that loads. This suits large fleets.

  • Hand-listed proxies that name a host the user lacks make mihomo fail with GLOBAL: 'Poland LTE' not found. The profile update still succeeds and the failure appears only when the config is applied. With global: listed the profile is blocked and refuses all traffic.

What counts as listed:

CaseResult
A node in the body's proxies, reachable through GLOBALAllowed.
A node that GLOBAL resolves to through filterAllowed.
The node is renamedStays allowed: permission follows the server, port and credentials, not the name.
Another server takes an allowed node's nameDenied.
A node from a proxy-providers sourceDenied, unless its definition matches an allowed inline node exactly.
DIRECT or REJECT listed in GLOBALAdds nothing.
filter matches no nodeThe group resolves to COMPATIBLE (or its empty-fallback), and Global mode is removed.
No GLOBAL group, or it reaches no inline nodeGlobal mode is removed, same as global: off.

Global mode only. In Rule mode, ordinary groups and rules decide.

No Global

yaml
policy:
  global: off

The app hides Global mode and the Core refuses it. A profile in Global mode switches to Rule. The body needs nothing.

Apps that must stay outside the VPN

Subscription body:

yaml
tun:
  exclude-package: [com.example.bank, com.example.gov]

Manifest:

yaml
policy:
  apps: required
Behaviorrecommended (default)required
Source of the listtun.exclude-package and apps.excludetun.exclude-package only
User can take an app backYesNo: locked, tagged "Required by provider"
Whitelist mode, or Access control offThe user's mode decidesStill excluded
Local proxy ports on AndroidOpenClosed
DesktopIgnoredIgnored
Android without VPN modeIgnoredIgnored: the profile connects without exclusions

apps: required works only on Android, in VPN mode; desktop and Android proxy mode ignore it and connect.

Excluded apps use the direct connection and the real IP. An exclusion is not a block: to block them, use Android lockdown mode. The VPN app itself cannot be excluded.

Errors the user can see:

MessageCauseFix
provider app exclusions are not applied; restart the VPNThe running VPN started with a different listRestart the VPN.
provider policy could not identify this applicationThe connection's app is unknownThe connection stays blocked.
provider policy requires this application to remain outside the VPNA listed app is still captured by an old VPN sessionRestart the VPN.

No local proxy ports

yaml
policy:
  local-ports: closed

Android only. Closes the mixed, HTTP, SOCKS, redir and TProxy ports, makes the web dashboard unavailable, and sends the app's own requests directly. apps: required turns this on as well.

Locked dashboard

yaml
policy:
  dashboard: locked

Removes editing on both dashboards. The layout you set in widgets stays.

When a lock applies

EventResult
A new valid manifest omits a keyThat lock is withdrawn with the next update.
A policy value is invalidThe whole section is withdrawn; the inspector shows a warning.
The manifest fetch failsThe last valid copy keeps its locks.
The subscription update failsNothing changes.
The response no longer has reclash-config, or the manifest was never fetchedNo locks. The body's rules work as plain mihomo config.
The user switches profileThe new profile's policy applies.
The mode or the lock changesOpen connections are closed.

Scripts, overrides and controller reloads cannot remove a lock: the Core derives it from the original profile file and keeps it outside config.yaml.

Limits

  • This protects a cooperating client, not your network. A client that does not read the manifest honors only the body's rules, and a modified one can ignore both. Enforce what must never happen on the server.

  • Excluding a package does not cover the same service opened in a browser.

Searches every section: providers and RCX