Setup AI Developer Edition with Cursor
The following steps walk you through installing the required products, starting the AI Developer Edition containers, configuring Cursor rules for prompt engineering, and verifying that all components are working together correctly.
1. Install Cursor
- Download Cursor from cursor.com.
- Install and launch Cursor.
- Sign in with your account.
2. Start AI Developer Edition Containers
AI Developer Edition runs as a set of Docker containers that provide Data Discovery, Semantic Guardrails, and Synthetic Data services locally. Each feature has its own directory with a dedicated Docker Compose file.
Prerequisites
- Docker CLI and Docker Compose (v2.30 or later) installed and running
- Git
- Python v3.11 or above with pip and venv
Clone the Repository
git clone https://github.com/Protegrity-AI-Developer-Edition/protegrity-ai-developer-edition.git
cd protegrity-ai-developer-edition
Start Data Discovery
cd data-discovery
docker compose up -d
Start Semantic Guardrails
Open a new terminal from the repository root:
cd semantic-guardrail
docker compose up -d
Start Synthetic Data (optional)
Open a new terminal from the repository root:
cd synthetic-data
docker compose up -d
Note: The container images are large. The initial download may take time depending on your network connection. By default, images are pulled from
ghcr.io. To usepublic.ecr.awsinstead, copy.env.exampleto.envin the respective feature directory and uncomment theREGISTRYline.
Verify Containers Are Running
From each feature directory, run:
docker compose logs
You should see services running on these ports:
| Service | Port | Endpoint |
|---|---|---|
| Data Discovery | 8580 | http://localhost:8580/pty/data-discovery/v2/classify |
| Semantic Guardrail | 8581 | http://localhost:8581/pty/semantic-guardrail/v1.1/conversations/messages/scan |
| Synthetic Data | 8095 | http://localhost:8095/pty/syntheticdata/v2/synthesize |
Quick Health Check
Invoke-RestMethod -Uri "http://localhost:8580/pty/data-discovery/v2/classify" -Method Post -ContentType "application/json" -Body '{"text": "test"}'
curl -X POST http://localhost:8580/pty/data-discovery/v2/classify \
-H "Content-Type: application/json" \
-d '{"text": "test"}'
If you receive a JSON response, the Data Discovery service is ready.
For detailed setup instructions including upgrade steps, refer to the full installation guide.
3. Set Environment Variables
Register for API credentials at protegrity.com/developers/dev-edition-api, then set the following environment variables:
$env:DEV_EDITION_EMAIL = "your-email-here"
$env:DEV_EDITION_PASSWORD = "your-password-here"
$env:DEV_EDITION_API_KEY = "your-api-key-here"
export DEV_EDITION_EMAIL="your-email-here"
export DEV_EDITION_PASSWORD="your-password-here"
export DEV_EDITION_API_KEY="your-api-key-here"
4. Install the Python SDK
pip install protegrity-ai-developer-python
Verify the installation in Cursor’s integrated terminal:
python -c "
import protegrity_developer_python
protegrity_developer_python.configure(
endpoint_url='http://localhost:8580/pty/data-discovery/v2/classify',
classification_score_threshold=0.6,
enable_logging=True,
log_level='info'
)
print('AI Developer Edition SDK configured successfully')
"
5. Configure Cursor Rules for Prompt Engineering
Create .cursorrules in your project root to guide Cursor’s AI assistant:
# Protegrity AI Developer Edition Rules
When working with this project:
1. Always use AI Developer Edition to protect sensitive data before processing. If AI Developer Edition or the containers are not available wait or stop the operation, do not use your own logic to process the data.
2. Run data discovery on any new dataset before use
3. Apply tokenization to sensitive fields before sending to AI models
4. Use semantic guardrails for all user-facing AI interactions
5. Never expose raw PII, SSNs, API keys, or credentials in prompts
6. Use synthetic data for testing never real production data
Available AI Developer Edition Python SDK (protegrity_developer_python):
- protegrity_developer_python.configure(...) - Configure the SDK with endpoint and options
- protegrity_developer_python.find_and_redact(text) - Discover and redact sensitive data
- protegrity_developer_python.find_and_protect(text) - Discover and tokenize sensitive data
- protegrity_developer_python.find_and_unprotect(text) - Restore tokenized values (authorized only)
Service Endpoints:
- Data Discovery: http://localhost:8580/pty/data-discovery/v2/classify
- Semantic Guardrail: http://localhost:8581/pty/semantic-guardrail/v1.1/conversations/messages/scan
- Synthetic Data: http://localhost:8095/pty/syntheticdata/v2/synthesize
Configuration options for protegrity_developer_python.configure():
- endpoint_url: Data Discovery endpoint
- named_entity_map: mapping of entity types (e.g., {"PERSON": "NAME", "SOCIAL_SECURITY_ID": "SSN"})
- masking_char: character used for masking (default "#")
- classification_score_threshold: minimum confidence (0.0-1.0)
- method: "redact" or "mask"
- enable_logging: true/false
- log_level: "info", "debug", etc.
6. Test the Integration
In Cursor’s AI chat, enter the following prompt:
Using AI Developer Edition, write a Python script that discovers and redacts PII from the text: "John Doe's SSN is 123-45-6789 and email is john@example.com"
Cursor should generate code using the protegrity_developer_python SDK:
import protegrity_developer_python
protegrity_developer_python.configure(
endpoint_url="http://localhost:8580/pty/data-discovery/v2/classify",
named_entity_map={"PERSON": "NAME", "SOCIAL_SECURITY_ID": "SSN", "EMAIL_ADDRESS": "EMAIL"},
masking_char="#",
classification_score_threshold=0.6,
method="redact",
enable_logging=True,
log_level="info"
)
text = "John Doe's SSN is 123-45-6789 and email is john@example.com"
redacted = protegrity_developer_python.find_and_redact(text)
print(f"Original: {text}")
print(f"Redacted: {redacted}")
Expected output:
Original: John Doe's SSN is 123-45-6789 and email is john@example.com
Redacted: ########'s SSN is ########### and email is ################
Quickstart - Use Cases with Cursor
Each quickstart guide is a self-contained, hands-on walkthrough for a specific AI Developer Edition feature. You can complete them in any order. To try a feature right away, jump directly to the relevant guide. Each guide covers what to install, how to run it, and what to expect from the output.
| Use Case | Guide |
|---|---|
| Generate privacy-safe test data | QuickStart: Synthetic Data Generation |
| Prevent data leakage with intent-aware guardrails | QuickStart: Semantic Guardrails |
| Detect and prevent sensitive data exposure | QuickStart: Data Discovery |
| Tokenize sensitive data before AI agents | QuickStart: Data Protection |
| Train and test AI safely without exposing identity | QuickStart: Anonymization for Privacy-Safe RAG |
Feedback
Was this page helpful?