This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Using AI Developer Edition for Agentic AI Use Cases

Sample prompts for using AI Developer Edition.

    This section provides sample prompts for using AI Developer Edition for agentic AI use cases. These prompts can be used as a starting point for building your own agentic AI applications.

    Training the Agent

    Start by training the agent to build your application. Use the following prompt to train the agent using the AI Developer Edition documentation and readme files:

    You are an AI coding agent specialized in building privacy-first applications using the Protegrity AI Developer Edition platform. Before writing any code, study the following documentation sources thoroughly:
    
    1. **Product documentation:** https://developer.docs.protegrity.com/docs/
    2. **Main repository (Docker setup, samples, config):** https://github.com/Protegrity-AI-Developer-Edition/protegrity-ai-developer-edition
    3. **Python SDK source & README:** https://github.com/Protegrity-AI-Developer-Edition/protegrity-ai-developer-python
    4. **Java SDK source & README:** https://github.com/Protegrity-AI-Developer-Edition/protegrity-ai-developer-java
    
    Learn and internalize the following platform capabilities so you can write Python and Java applications when asked:
    
    ## Platform Architecture
    - Containerized services orchestrated via Docker Compose (`docker compose up -d`).
    - **Data Discovery** (port 8580) PII/PCI/PHI classification with confidence scoring. No registration needed.
    - **Semantic Guardrail** (port 8581) Risk evaluation for GenAI conversations. Processors: `semantic`, `pii`. Verticals: Customer Service, Finance, Healthcare.
    - **Synthetic Data** (port 8095, `--profile synthetic`) Privacy-preserving artificial data generation.
    - **Data Protection** Tokenization, encryption, and format-preserving encryption via the API Service. **Registration required** at https://www.protegrity.com/developers/dev-edition-api.
    
    ## Python SDK (`protegrity-ai-developer-python`, PyPI v1.1.1)
    Two modules:
    - **`protegrity_developer_python`** Data discovery + redaction/masking/protection of unstructured text. Key functions: `configure()`, `find_and_redact()`, `find_and_protect()`, `find_and_unprotect()`.
    - **`appython`** Structured data protection via `Protector` and `Session` classes. Supports single/bulk protect/unprotect, encryption/decryption, reprotect, and context managers.
    
    ## Java SDK (`protegrity-ai-developer-edition`, Maven Central v1.1.0)
    Two modules:
    - **`protegrity-ai-developer-edition`** Data discovery using `Discover.discover()`, `PiiProcessing.collectEntitySpans()`, `PiiProcessing.redactData()`, `PiiProcessing.protectData()`, `PiiProcessing.unprotectData()`.
    - **`application-protector-java`** Structured data protection via `Protector.getProtector()`, `createSession()`, `protect()`, `unprotect()`, `reprotect()`.
    
    ## Key Conventions
    - Configuration is managed via `samples/config.json` (entity map, masking char, method, threshold).
    - Environment variables for protection APIs: `DEV_EDITION_EMAIL`, `DEV_EDITION_PASSWORD`, `DEV_EDITION_API_KEY`.
    - Classification endpoint: `http://localhost:8580/pty/data-discovery/v2/classify`.
    - Available data elements: `name`, `ssn`, `ccn`, `email`, `phone`, `address`, `city`, `postcode`, `zipcode`, `iban`, `passport`, `nin`, `text`, `string`, `number`, `datetime`, and FPE variants.
    - RBAC users: `superuser` (full access, testing only), `admin`, `finance`, `marketing`, `hr`, and named users with role-specific protect/unprotect permissions.
    - Entity-to-data-element mapping: PERSON→name, SOCIAL_SECURITY_ID→ssn, CREDIT_CARD→ccn, EMAIL_ADDRESS→email, PHONE_NUMBER→phone, LOCATION→address/city.
    
    ## Rules for Code Generation
    - Always configure the SDK before calling any discovery or protection functions.
    - For protection/unprotection operations, ensure environment variables are set and remind the user about registration.
    - Use `superuser` as the default policy user for examples unless a specific role is requested.
    - Handle errors appropriately: `InitializationError`, `InvalidSessionError`, `ProtectError` (Python); `ProtectorException` (Java).
    - Data Discovery and Semantic Guardrail do NOT require registration, only Data Protection does.
    

    Registering for API Access

    Note: This step is only required for data protection.

    To use the Data Protection capabilities of the AI Developer Edition, you need to register for API access. Use the following prompt to guide users through the registration process. Ensure that you update the variables for the information required for filling the form as required:

    Run these steps. I can provide the information for the form as required:
    1. Open a web browser.
    2. Navigate to [https://www.protegrity.com/developers/dev-edition-api](https://www.protegrity.com/developers/dev-edition-api).
    3. Specify the following details:
    -   First Name: <Name>
    -   Last Name: <Name>
    -   Work Email: <Email>
    -   Job Title: <Job Title>
    -   Company Name: <Company Name>
    -   Country: <Country>
    4. Click the **Terms & Conditions** link and read the terms and conditions.
    5. Select the check box to accept the terms and conditions.
    6. Click **Get Started**.
    

    Provide the Credentials for API Access

    After registering for API access, you will receive an email with your credentials. Provide the credentials to the agent to enable it to use the Data Protection capabilities:

    Use the following credentials to access the API. Keep this information secure:
    EMail: <Email>
    Password: <Password>
    API Key: <API Key>
    

    Building an Application

    Now you can provide prompts to build applications using the AI Developer Edition. Here are some sample prompts for building applications:

    Sample Prompt 1: Building a Customer Service Chatbot with Semantic Guardrails

    This prompt guides the AI agent to build a customer service chatbot that uses Semantic Guardrail API to assess risk in real time. It classifies each conversation using the semantic processor, flags potentially sensitive or risky content, and provides immediate feedback to the user. It does all this while supporting multiple concurrent sessions.

    Build a customer service chatbot that uses the Semantic Guardrail to evaluate the risk of GenAI conversations. The chatbot should be able to classify the conversation using the `semantic` processor and provide feedback to the user if the conversation is deemed risky. Use the following steps:
    1. Configure the Semantic Guardrail SDK with the appropriate settings.
    2. Implement a function to classify the conversation using the `semantic` processor.
    3. Provide feedback to the user based on the classification results.
    4. Ensure that the chatbot can handle multiple conversations simultaneously.
    

    Sample Prompt 2: Building a Data Protection Application

    This prompt asks the AI agent to build an end-to-end data protection pipeline that combines all three core capabilities, that is Data Discovery, Semantic Guardrails, and Data Protection. It scans an input file for PII, evaluates the content for risk, redacts names with a masking character, and tokenizes phone numbers so they can be recovered later. It then writes the processed output to a new file with a summary of actions taken.

    Build a Python application that combines Data Discovery, Semantic Guardrails, and Data Protection to process a user-provided input file as follows:
    
    Data Discovery: Scan the input file to identify all PII entities, including but not limited to names and telephone numbers, with confidence scores.
    
    Semantic Guardrails: Evaluate the discovered content for risk and flag any sensitive data that should not pass through unprotected.
    
    Redaction: Replace all detected name entities with the # character (for example, "John Smith" → "#### #####").
    
    Tokenization: Protect all detected telephone/phone number entities using the Protegrity Data Protection API with the phone data element, so the original values can be recovered later with unprotect.
    
    Output: Write the processed content with names redacted and phone numbers tokenized to a new output file, and print a summary showing how many names were redacted and how many phone numbers were tokenized.
    
    Requirements:
    
    Accept the input file path as a command-line argument.
    Use the protegrity-ai-developer-python SDK (appython module).
    Handle both structured (CSV/tabular) and unstructured (plain text) file formats.
    Log each detected entity with its type, original value, confidence score, and the action taken (redacted or tokenized).
    

    Sample Prompt 3: Building a Data Discovery Application

    This prompt instructs the AI agent to build a Java application that uses the Data Discovery API to scan and classify text for PII entities. It walks through configuring the Java SDK, running classification on the input, displaying each detected entity with its confidence score, and handling any errors during the process.

    Build a Java application that uses the Data Discovery capabilities of the AI Developer Edition to classify a given text input and identify any PII entities. The application should perform the following steps:
    1. Configure the Java SDK with the appropriate settings.
    2. Implement a function to classify the input text and identify PII entities.
    3. Print the identified entities along with their confidence scores.
    4. Handle any errors that may occur during the classification process.
    

    Sample Prompt 4: Building a Data Protection Application with Python SDK

    This prompt asks the AI agent to fetch the Protegrity AI Developer Edition Python SDK, explore the available data elements and functions, and then write a Python application. The application discovers and protects PII from a single conversational prompt referencing the GitHub repository.

    I want to use Protegrity AI developer edition to protect my data. Can you get the relevant SDK. Also get me the data elements that can be used and functions. Write a python code to find and protect data . You can refer - https://github.com/Protegrity-AI-Developer-Edition/protegrity-ai-developer-edition. Install the required SDK. Also pull the core data elements and functions that I can use in Dev Edition.
    

    Sample Prompt 5: Building a Data Protection Application with Java SDK

    This prompt asks the AI agent to generate Java sample code that integrates Protegrity data protection as a preprocessor guardrail within a LangChain pipeline. It masks credit card numbers and tokenizes IP addresses and dates of birth before they reach the LLM.

    Write sample code to protect the PII data as a preprocessor guardrail to Langchain pipeline. Here I want to mask credit card number, tokenize IP address, and dob.
    

    Sample Prompt 6: Building a Data Protection Application without Docker Setup

    This prompt demonstrates a minimal, no-infrastructure approach. It asks the AI agent to protect data using the Protegrity API Service directly, without spinning up any Docker containers. This approach is ideal for quick prototyping or environments where Docker is unavailable.

    I want to protect data without any docker setup. Can you run the steps for me.