How to Enable Network Traffic Inspection

This guide shows you how to set up network traffic inspection for the Privacy AI app. This is useful for developers who want to see what data is being sent to and received from AI services.


What You Need

  1. A computer (Mac or Windows) to run the inspection tool
  2. Your iPhone or iPad with Privacy AI installed
  3. Both devices on the same Wi-Fi network

Part 1: Set Up Your Computer

On Mac

Step 1: Install mitmproxy

Open Terminal and run:

brew install mitmproxy

If you don't have Homebrew installed, visit https://brew.sh first.

Step 2: Choose a Certificate

You have two options for the certificate. Choose one:

Option A: Use mitmproxy's Built-in Certificate (Easier)

mitmproxy comes with its own certificate. This is the simpler option:

  1. Start mitmproxy once to generate its certificate:
    mitmproxy
    
  2. Press q to quit after it starts
  3. The certificate files are now in ~/.mitmproxy/
  4. Skip to Step 4 (you don't need to set up a custom confdir)

For detailed instructions, see: https://docs.mitmproxy.org/stable/concepts/certificates/#quick-setup

Option B: Use Privacy AI's Certificate

Privacy AI includes its own certificate. Use this option if you want the same certificate on multiple devices:

  1. Open Privacy AI on your iPhone/iPad
  2. Go to Settings > Proxy
  3. Tap Export Certificate for Proxy
  4. Choose how to send the files to your Mac:
    • AirDrop: Select your Mac from the list (fastest method)
    • Email: Send to yourself and download the attachment
    • Save to Files: Save to iCloud Drive, then access from your Mac
  5. Save the files somewhere you can find them (e.g., Desktop)

Step 3: Set Up the Certificate for mitmproxy

Skip this step if you chose Option A (mitmproxy's built-in certificate).

If you chose Option B (Privacy AI's certificate):

  1. Create a folder for mitmproxy settings:

    mkdir -p ~/mitmproxy_config
    
  2. Copy the combined certificate to this folder with the name mitmproxy expects:

    cp /path/to/PrivacyAIProxyCA-combined.pem ~/mitmproxy_config/mitmproxy-ca.pem
    

    Replace /path/to/ with where you saved the file (e.g., ~/Desktop/)

Step 4: Start mitmproxy

Run one of these commands depending on which certificate option you chose:

If you chose Option A (mitmproxy's built-in certificate):

mitmweb --mode regular --listen-port 8081

If you chose Option B (Privacy AI's certificate):

mitmweb --mode regular --listen-port 8081 --set confdir=~/mitmproxy_config

You should see the mitmproxy interface appear. Keep this window open.

mitmproxy webui

Step 5: Find Your Computer's IP Address

  1. Open System Settings > Network
  2. Click on your Wi-Fi connection
  3. Look for the IP address (it looks like 192.168.x.x or 10.x.x.x)
  4. Write this down - you'll need it for your iPhone/iPad

On Windows

Step 1: Install mitmproxy

  1. Visit https://mitmproxy.org
  2. Download the Windows installer
  3. Run the installer and follow the prompts

Step 2: Choose a Certificate

You have two options for the certificate. Choose one:

Option A: Use mitmproxy's Built-in Certificate (Easier)

mitmproxy comes with its own certificate. This is the simpler option:

  1. Open Command Prompt and start mitmproxy once:
    mitmproxy
    
  2. Press q to quit after it starts
  3. The certificate files are now in C:\Users\YourName\.mitmproxy\
  4. Skip to Step 4 (you don't need to set up a custom confdir)

For detailed instructions, see: https://docs.mitmproxy.org/stable/concepts/certificates/#quick-setup

Option B: Use Privacy AI's Certificate

Privacy AI includes its own certificate. Use this option if you want the same certificate on multiple devices:

  1. Open Privacy AI on your iPhone/iPad
  2. Go to Settings > Proxy
  3. Tap Export & Share
  4. Choose how to send the files to your Windows PC:
    • Email: Send to yourself and download the attachment
    • Save to Files: Save to iCloud Drive or OneDrive, then access from your PC
    • USB: Connect your device and copy files via iTunes/Finder
  5. Save the files somewhere you can find them (e.g., Desktop)

Step 3: Set Up the Certificate for mitmproxy

Skip this step if you chose Option A (mitmproxy's built-in certificate).

If you chose Option B (Privacy AI's certificate):

  1. Create a folder: C:\mitmproxy_config
  2. Copy PrivacyAIProxyCA-combined.pem to this folder
  3. Rename it to mitmproxy-ca.pem

Step 4: Start mitmproxy

Open Command Prompt and run one of these commands:

If you chose Option A (mitmproxy's built-in certificate):

mitmproxy --mode regular --listen-port 8080

If you chose Option B (Privacy AI's certificate):

mitmproxy --mode regular --listen-port 8080 --set confdir=C:\mitmproxy_config

Step 5: Find Your Computer's IP Address

  1. Open Settings > Network & Internet > Wi-Fi
  2. Click on your connected network
  3. Scroll down to find "IPv4 address"
  4. Write this down

Part 2: Set Up Your iPhone or iPad

Step 1: Install the Certificate

  1. Open Privacy AI app
  2. Go to Settings > Proxy
  3. Tap Install Certificate or the guide button
  4. Tap Install on this device
  5. Safari will open and download the certificate
  6. You'll see a message saying "Profile Downloaded"

Install on this device

Step 2: Install the Profile

  1. Open the Settings app on your device
  2. You should see "Profile Downloaded" near the top - tap it
  3. If you don't see it, go to Settings > General > VPN & Device Management
  4. Tap the PrivacyAI Proxy Certificate profile
  5. Tap Install in the top right
  6. Enter your device passcode
  7. Tap Install again to confirm

Profile DownloadInstall Profile

Step 3: Trust the Certificate

This is a critical step that's easy to miss:

  1. Go to Settings > General > About
  2. Scroll to the bottom and tap Certificate Trust Settings
  3. Find PrivacyAI in the list
  4. Turn ON the toggle next to it
  5. Tap Continue on the warning message

Trust certificate

Step 4: Enable Proxy in Privacy AI

  1. Open Privacy AI app
  2. Go to Settings > Proxy
  3. Turn ON Enable Proxy
  4. Enter your computer's IP address in the Host field
  5. Keep the Port as 8080
  6. Tap Test Connection to verify it works

Enable proxy


Part 3: Start Inspecting Traffic

  1. Make sure mitmproxy is running on your computer
  2. Make sure proxy is enabled in Privacy AI
  3. Send a message in Privacy AI
  4. Watch the mitmproxy window - you should see the requests appear!

Mitmproxy WEB UI


Troubleshooting

"Certificate not trusted" or TLS errors

  • Make sure you completed Step 3 in Part 2 (trusting the certificate)
  • The toggle in Certificate Trust Settings must be ON

"Connection failed" when testing

  • Make sure both devices are on the same Wi-Fi network
  • Check that mitmproxy is running on your computer
  • Verify the IP address is correct
  • Make sure your computer's firewall allows connections on port 8080

Can't see any traffic in mitmproxy

  • Make sure proxy is enabled in Privacy AI settings
  • Try sending a test message
  • Check the host and port settings match

mitmproxy shows errors

  • Make sure you copied the certificate file correctly
  • The file must be named exactly mitmproxy-ca.pem
  • The file must be in the confdir folder

When You're Done

To stop inspecting traffic:

  1. In Privacy AI, go to Settings > Proxy and turn OFF Enable Proxy
  2. On your computer, press q in mitmproxy to quit

You can leave the certificate installed on your device - it won't affect normal usage when the proxy is disabled.


Need Help?

If you're having trouble, please visit our support page or create an issue on GitHub.