Overview
The Android Rooting Policy in Swif.ai helps you protect corporate data by detecting rooted or otherwise compromised Android devices and automatically disabling them.
When enabled, Swif uses the Google Play Integrity / Android Management security posture reported for each device. If Google flags a device as AT_RISK or POTENTIALLY_COMPROMISED (for example, due to a compromised OS / rooting), Swif evaluates this policy and, by default, disables the device.
Requirements
Minimum Android version: Android 9+
Supported platform: Android (managed via Android Management API / Android Enterprise)
Owner: Company-managed policy (cannot be end-user modified)
What the policy does
When the policy is active on a device or device group:
Swif receives STATUS_REPORT events from Google (via Pub/Sub) that contain the device’s SecurityPosture.
If the posture is:
SECURE→ No action is taken.AT_RISKorPOTENTIALLY_COMPROMISED→ Swif checks whether the Android Rooting Policy is enabled for that device.
If the policy is enabled and the configured action is
DISABLE(default):Swif calls DisableDevice via the Android Management API.
The device’s state is set to DISABLED.
The user sees a customizable message explaining that the device is disabled due to a security risk.
If the policy is disabled or not assigned:
Swif does not modify the device state, even if it is AT_RISK or POTENTIALLY_COMPROMISED.
This means:
You can enforce that only devices with an uncompromised OS can access corporate apps and data.
If you later resolve the issue, you can re-enable the device by setting its state back to
ACTIVEand clearing thedisabledReason(handled by Swif’s backend / admin actions, as discussed in ST-6371).
Configuration Fields
The Android Rooting Policy exposes the following configuration fields in Swif.ai:
1. Enable Root Detection (rootDetectionEnabled)
Display name: Enable Root Detection
Type: Boolean (true / false)
Required: Yes (field must be present; default is
false)Default value:
falseMinimum system requirements: Android 9+
Description:
Turns the rooting / compromised OS detection on or off for the devices assigned to this policy.
When true:
Swif monitors the device security posture reported by Google.
If the device is reported as AT_RISK or POTENTIALLY_COMPROMISED, Swif evaluates this policy and applies the configured action (currently: DISABLE).
When false:
Swif ignores AT_RISK / POTENTIALLY_COMPROMISED signals for this policy.
No enforcement action is taken by this policy, even if Google reports a compromised posture.
Typical usage:
Set to true for high-security fleets where rooted/compromised devices must not access corporate data.
Leave as false if you only want to monitor posture via other reports, without automatically disabling devices.
2. Action (action)
Display name: Action
Type: String (drop-down)
Required: Optional
Default value:
DISABLEAllowed values:
""(empty – interpreted as “use default”)DISABLE
Minimum system requirements: Android 9+
Description:
Controls what Swif does when a rooted or compromised device is detected and root detection is enabled.
DISABLESwif calls the DisableDevice operation via the Android Management API.
The device state is set to DISABLED.
The user is blocked from using the device for managed apps and data and will see the associated message.
""(empty)Swif falls back to the default enforcement behavior.
In the current implementation, that default resolves to
DISABLEwhenrootDetectionEnabledis true.
If rootDetectionEnabled is false, this field is effectively ignored and no action is taken.
3. Disabled Message (disabledMessage)
Display name: Disabled Message
Type: String (free text)
Required: Optional
Default value:
This device has been disabled because it appears to be rooted or compromised. Please contact your IT administrator.Minimum system requirements: Android 9+
Description:
Custom message displayed to the end user when their device has been disabled because it is considered rooted or compromised.
If you set a custom message, the user will see that string when their device is disabled by this policy.
If you leave it empty, Swif will use the default message above.
Examples:
High security environment:
“Rooted device detected. Corporate data access has been revoked. Contact IT to restore access.”
Standard corporate messaging:
“This device has been disabled because it appears to be rooted or compromised. Please contact your IT administrator.”
How Swif interprets device posture
Swif relies on the device posture coming from Google’s Android Management / Play Integrity signals. The raw decision of whether a device is AT_RISK or POTENTIALLY_COMPROMISED is determined by Google’s services (not by Swif).
Internally, the flow (as validated in ST-6371) is:
Swif receives a STATUS_REPORT event.
It reads:
SecurityPosture.DevicePosture→ e.g.SECURE,AT_RISK,POTENTIALLY_COMPROMISED(Optionally)
PostureDetails[].SecurityRisk→ e.g.UNKNOWN_OS,COMPROMISED_OS,HARDWARE_BACKED_EVALUATION_FAILED
Swif decides whether the posture requires enforcement:
SECURE→ no enforcement (policy skipped).AT_RISKorPOTENTIALLY_COMPROMISED→ enforcement is required.
If enforcement is required and an Android Rooting Policy is assigned:
If
rootDetectionEnabled == false→ skip, no action.If
rootDetectionEnabled == true:Resolve
action(empty →DISABLE).Resolve
disabledMessage(empty → default string).If final action is
DISABLE, Swif calls the DisableDevice API and sets the device state to DISABLED with the resolved message.
If no Android Rooting Policy is assigned to the device, Swif logs that no policy is present and takes no action, even if the posture is AT_RISK or POTENTIALLY_COMPROMISED.
For the detailed simulated scenarios and logs used to validate this behavior, see the attachment in Jira:
security_posture_flow_test.go in https://swifteam.atlassian.net/browse/ST-6371?search_id=f632f1c8-467e-4d0d-adb5-3e6bb3fcbe28&referrer=quick-findPreview
Example scenarios
The following examples summarize what happens in common cases (based on the test flow in ST-6371):
AT_RISK device + policy ENABLED (action: DISABLE)
Posture:
AT_RISK(e.g.UNKNOWN_OS)rootDetectionEnabled = true,action = DISABLEResult: Device is DISABLED, user sees your configured message.
POTENTIALLY_COMPROMISED (rooted) + policy ENABLED
Posture:
POTENTIALLY_COMPROMISED(e.g.COMPROMISED_OS)rootDetectionEnabled = true,action = DISABLEResult: Device is DISABLED with your custom message (for example, “Rooted device detected. Corporate data access has been revoked.”).
POTENTIALLY_COMPROMISED + policy DISABLED
Posture:
POTENTIALLY_COMPROMISEDrootDetectionEnabled = falseResult: No action. Root detection is considered off.
SECURE device + policy ENABLED
Posture:
SECURErootDetectionEnabled = trueResult: No action. Device remains active.
AT_RISK device + no Android Rooting Policy assigned
Posture:
AT_RISKNo rooting policy on that device/group
Result: No action. Enforcement is skipped because no policy is present.
AT_RISK device + policy enabled but empty action/message
Posture:
AT_RISKrootDetectionEnabled = true,action = "",disabledMessage = ""Result: Swif resolves:
action→DISABLEdisabledMessage→ default message
Device is DISABLED with the default message.
Recommended configuration
For most organizations that want to block rooted or compromised devices:
Enable Root Detection:
Set Enable Root Detection (
rootDetectionEnabled) to true.
Action:
Keep Action set to DISABLE.
Disabled Message:
Use a clear, user-friendly message that:
Explains that the device appears rooted or compromised.
Tells the user how to contact IT or support.
Example:
“This device has been disabled because it appears to be rooted or compromised. Please contact your IT administrator.”
Test in a limited group first:
Assign the policy to a test group or small pilot set of Android devices.
Review behavior and user experience before rolling out broadly.
Re-enabling a disabled device
If a device was disabled by the Android Rooting Policy and you need to restore access:
Resolve the underlying security issue (e.g., unroot or replace the device, or verify that it was a false positive).
Use Swif’s device management actions to re-enable the device. Internally this maps to:
Setting the device state back to ACTIVE in the Android Management API.
Clearing any
disabledReasonassociated with the prior enforcement.
