SecureStorage

Register the native Android secure-storage tool suite to read and mutate secure-storage values under explicit key allow-lists.

Warning: Every tool in this suite is Critical because it can expose or mutate secrets. Keep the allow-list narrow and only enable this suite when you explicitly need secure-storage inspection or repair.

Install

Published artifact: ai.ansight:ansight-tools-securestorage-android.

dependencies {
    debugImplementation("ai.ansight:ansight-tools-securestorage-android:1.0.2-preview.1")
}

Register the Suite

import ai.ansight.runtime.AnsightOptions
import ai.ansight.tools.securestorage.withSecureStorageTools

val options = AnsightOptions.createBuilder()
    .withSecureStorageTools {
        withPreferencesName("secure_debug")
        allowKeyPrefix("debug.")
    }
    .withReadWriteToolAccess()
    .build()

Registration API

  • withSecureStorageTools(...): registers the suite.
  • withPreferencesName(...): sets the secure-storage preferences name.
  • allowKey(...) / allowKeyPrefix(...): allow specific keys or key prefixes.

Specific Concerns

  • Values may contain credentials, tokens, or other secrets.
  • Keep key allow-lists narrow.
  • secure.set_value is write-scoped.
  • secure.remove_key is delete-scoped and requires withAllToolAccess().

Tool Matrix

NameIdScopeDescriptionSecurity
Get Secure Storage Valuesecure.get_valueReadReads a value from the configured secure storage backend.Critical
Set Secure Storage Valuesecure.set_valueWriteWrites a secure-storage value.Critical
Remove Secure Storage Keysecure.remove_keyDeleteDeletes a secure-storage key.Critical

Tool Details

Use these tools only for explicit local debugging and repair workflows. Keep the key allow-list narrow.