Skip to main content
Secure Sessions create a “clean room” for collecting sensitive data like credit card numbers, Social Security Numbers, and PINs. The AI never sees the raw values, ensuring compliance with data privacy standards including PCI-DSS.

The problem

Traditional AI agents process all input through the LLM:
This violates PCI-DSS requirements that prohibit storing unencrypted cardholder data.

The solution

Iqra AI’s Secure Sessions bypass the AI layer entirely for sensitive input:

How it works

DTMF input collection

Use the DTMF Input system tool with encryption enabled:
boolean
required
Set to true for secure data collection
string
required
Variable to store encrypted value
integer
required
Maximum digits (e.g., 16 for credit cards)
boolean
default:"false"
Require # key to finish input (recommended)
Example configuration:

Variable isolation

Mark the variable as hidden from the AI:
With IsVisibleToAgent: false, the variable:
  • Does NOT appear in the LLM system prompt
  • Does NOT appear in conversation history
  • Does NOT appear in embeddings or RAG context
  • Is NOT included in tool call contexts (unless explicitly passed)

Validation without exposure

Pass the encrypted value to your backend for validation:
The AI only sees pin_validation_result (“valid” or “invalid”), never the actual PIN.

PCI-DSS compliance flow

Here’s a complete PCI-compliant credit card collection workflow:
1

Prompt for card number

2

Collect encrypted input

3

Prompt for CVV

4

Collect encrypted CVV

5

Validate with payment processor

Your backend:
  1. Decrypts the inputs
  2. Sends to payment processor (Stripe, Square, etc.)
  3. Receives token
  4. Returns token + safe metadata
6

Store token, discard card data

7

Confirm with safe information

The AI speaks non-sensitive metadata only.
The encrypted card data is automatically purged after the session ends. Only the token persists for future transactions.

Security architecture

Encryption layer

When EncryptInput: true, Iqra AI:
  1. Captures DTMF tones directly from the media stream
  2. Converts tones to digits in-memory (never written to disk)
  3. Encrypts using AES-256-GCM with session-specific key
  4. Stores ciphertext in variable
  5. Clears plaintext from memory immediately

Key management

Encryption keys are:
  • Generated per-session (ephemeral)
  • Rotated every 24 hours for long-running sessions
  • Never logged or persisted
  • Destroyed when session ends

Decryption handoff

Only your backend can decrypt:
Your backend must be PCI-DSS compliant to handle decrypted cardholder data. Use a certified payment processor (Stripe, Braintree) whenever possible instead of handling raw card data.

Variable visibility matrix

Recommendation: Use IsVisibleToAgent: false + EncryptInput: true for maximum security.

Common use cases

PIN verification

Social Security Number collection

Credit card payment

See PCI-DSS compliance flow above.

Account number lookup

Even non-sensitive data like account numbers benefit from encryption to prevent social engineering attacks where attackers guess account numbers.

Best practices

Always use encryption for:

  • Credit/debit card numbers
  • CVV/CVC codes
  • Bank account numbers
  • Social Security Numbers
  • PINs and passwords
  • Health record identifiers (HIPAA)
  • Any personally identifiable information (PII)

Provide clear instructions

Users aren’t used to entering long numbers via keypad:

Set appropriate timeouts

Longer inputs need more time:
  • 4-digit PIN: 10-15 seconds
  • 16-digit card number: 30-45 seconds
  • 9-digit SSN: 20-30 seconds

Implement retry logic

Confirm without revealing

Purge after use

Encrypted variables are automatically purged when the session ends, but you can also explicitly clear them:

Testing secure sessions

Development mode

During testing, you can log encrypted values to verify collection:
Never enable this logging in production.

Test card numbers

Use standard test cards for validation:
  • Visa: 4532-1234-5678-9010
  • Mastercard: 5425-2334-3010-9903
  • Amex: 3782-822463-10005

Mock backend responses

Your Custom Tool can return mock validation during testing:

Compliance certifications

Iqra AI infrastructure is designed for:
  • PCI-DSS Level 1 - Payment card data protection
  • HIPAA - Healthcare information privacy
  • SOC 2 Type II - Security and availability controls
  • GDPR - EU data protection requirements
Your implementation must also be compliant. Use certified payment processors and consult with compliance experts before handling sensitive data.

Next steps

Script nodes

Learn about DTMF Input and other nodes

Action flows

Build validation workflows

Custom tools

Integrate with payment processors

Compliance

Security and compliance documentation