---
id: post/aardvarklabs-blog/2640
type: post
title: Securing Sensitive Data in Business Central AL using SecretText
summary: SecretText is a data type in Business Central AL that protects sensitive values like API keys and authentication credentials from being exposed in debuggers or passed insecurely between procedures. The post demonstrates how to use SecretText with JSON objects and isolated storage to keep secrets hidden during extension development.
tier: community
language: en
tags:
  - security
  - secrettext
  - api authentication
  - isolated storage
  - json
  - debugging
  - sensitive data
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T01:59:02.570Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 89d7c2ed6262c6f7d9469391e50f37febadf62272e710f28a15186d40e41c8b1
evidence:
  - kind: blog
    url: https://aardvarklabs.blog/2025/09/26/securing-sensitive-data-in-business-central-al-using-secrettext/
    title: Securing Sensitive Data in Business Central AL using SecretText
    date: "2025-09-26"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://aardvarklabs.blog/2025/09/26/securing-sensitive-data-in-business-central-al-using-secrettext/
    title: Securing Sensitive Data in Business Central AL using SecretText
    date: "2025-09-26"
    commit: null
    t: null
    quote: When I look at this with my debugger all the SecretText values are displayed as HiddenValues. No snooping for me!
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "2640"
source_id: aardvarklabs-blog
source_name: Aardvark Labs
url: https://aardvarklabs.blog/2025/09/26/securing-sensitive-data-in-business-central-al-using-secrettext/
published_at: "2025-09-26T12:00:00.000Z"
author: Marcel Chabot
full_text: false
words: 740
quotes:
  - text: When I look at this with my debugger all the SecretText values are displayed as HiddenValues. No snooping for me!
    why_it_matters: Demonstrates that SecretText protects against debugger inspection, a key threat when handling API keys and credentials
code_objects_mentioned: []
systems:
  - development
  - integration
versions_mentioned: []
preview:
  embeddable: true
  frame_url: https://aardvarklabs.blog/2025/09/26/securing-sensitive-data-in-business-central-al-using-secrettext/embed/
  image: https://aardvarklabs.blog/wp-content/uploads/2025/09/oig4.jpeg
  image_alt: null
  image_w: 1024
  image_h: 1024
  site_name: Aardvark Labs
  favicon: https://aardvarklabs.blog/wp-content/uploads/2024/04/design-1.png?w=32
  probed_at: "2026-10-07T11:51:32.267Z"
---

# Securing Sensitive Data in Business Central AL using SecretText

[Read the post](https://aardvarklabs.blog/2025/09/26/securing-sensitive-data-in-business-central-al-using-secrettext/) · Aardvark Labs (Marcel Chabot) · 2025-09-26 · 740 words · tier community · reviewed (checked by Opus)

> SecretText is a data type in Business Central AL that protects sensitive values like API keys and authentication credentials from being exposed in debuggers or passed insecurely between procedures. The post demonstrates how to use SecretText with JSON objects and isolated storage to keep secrets hidden during extension development.

## Key points

- SecretText variables display as HiddenValues in the debugger and cannot be converted back to plain text
- Use WriteWithSecretsTo method with a Dictionary to safely embed SecretText values into JSON objects by replacing placeholders
- SecretText can be retrieved from Isolated Storage or Azure Vault and used with HTTPClient and Azure OpenAI authentication
- SecretText implements a write-once reveal-never pattern where values are stored once but never retrieved in human-readable form

## Quotes

- "When I look at this with my debugger all the SecretText values are displayed as HiddenValues. No snooping for me!" (Demonstrates that SecretText protects against debugger inspection, a key threat when handling API keys and credentials)

## Context

- Features: SecretText data type, WriteWithSecretsTo method, Isolated Storage, HTTPClient, Azure OpenAI, Dictionary, JsonObject

Source: Aardvark Labs, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
