ShellPolicy

data class ShellPolicy(val deniedSettingKeys: Set<String> = emptySet(), val deniedPermissions: Set<String> = emptySet())

Optional host-side denylist for the dedicated shell tools. Passed to ShellTools.all (and the ShizukuTools / RootTools providers); the LLM cannot change it.

The dedicated tools are powerful even without run_shell: put_secure_setting can enable an accessibility service or notification listener, switch the default IME or turn on ADB; grant_permission can grant development permissions such as WRITE_SECURE_SETTINGS. So the default everywhere is RECOMMENDED, which denies the keys in RECOMMENDED_DENIED_SETTING_KEYS and the permissions in RECOMMENDED_DENIED_PERMISSIONS. A host that really needs those writes opts out explicitly:

ShizukuTools.all(context, ShellPolicy.PERMISSIVE)

Denied calls return a denied_by_policy error without spawning anything.

Constructors

Link copied to clipboard
constructor(deniedSettingKeys: Set<String> = emptySet(), deniedPermissions: Set<String> = emptySet())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

permissions grant_permission refuses to grant. Matched exactly (permission names are case-sensitive). revoke_permission is not affected.

Link copied to clipboard

settings keys put_secure_setting / put_global_setting / put_system_setting refuse to write, in any namespace. Matched case-insensitively.

Functions

Link copied to clipboard

True if granting permission is denied.

Link copied to clipboard

True if writing settings key key is denied.