SecureStorage

Configure the React Native native secure-storage tools to read and mutate native 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.

Register the Suite

await Ansight.initializeAndActivate(
  Ansight.createOptionsBuilder()
    .withRemoteTools({
      secureStorage: {
        appleService: "com.example.app",
        preferencesName: "secure_debug",
        allowedKeys: ["debug_token"],
        allowedKeyPrefixes: ["debug."],
      },
    })
    .withReadWriteToolAccess()
    .build(),
);

Registration API

  • withRemoteTools({ secureStorage: ... }): configures native secure-storage options.
  • remoteTools.secureStorage.appleService: iOS Keychain service.
  • remoteTools.secureStorage.preferencesName: Android secure-storage preferences name.
  • remoteTools.secureStorage.allowedKeys / allowedKeyPrefixes: restrict keys.
  • top-level secureStorage is accepted as a compatibility alias.

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 secure-storage value.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.