shield-quarteredSecurity and Privacy

Protect sensitive data while using the AIP SDK and CLI. This guide covers PII masking, tool-output controls, memory scoping, and API key hygiene.

Success

When to use this guide: You handle regulated data, govern tooling access, or perform privacy reviews on agent configurations.

Who benefits: Security engineers, PMs overseeing compliance, and data developers stewarding user content.

circle-info

Security features by surface are tracked in the AIP capability matrixarrow-up-right. Key gaps today: CLI still relies on export/import for pii_mapping, memory, and tool-output toggles. Presigned URL regeneration and some auditing workflows use REST reference endpoints.

Mask PII During Runs

When to use: Redact sensitive inputs or outputs before sharing transcripts or artifacts.

circle-exclamation
from glaip_sdk import Agent

agent = Agent(name="secure-processor", instruction="Process sensitive inputs.")
response = agent.run(
    "Process <EMAIL_1> order",
    pii_mapping={
        "<EMAIL_1>": "customer@example.com",
        "<NAME_1>": "Alex Taylor",
    },
)
print(response)
circle-info

Until CLI flags ship, export the agent JSON, add a pii_mapping example, and re-import for automation scenarios.

Common security gaps

Symptom
Likely cause
Fix

PII still appears in outputs

Redaction rules incomplete or mismatch between SDK and backend.

Expand pii_mapping entries and test with sample payloads.

Shared artifacts visible to unintended teams

agent_config.tool_output_sharing left enabled.

Disable sharing or scope agents per team.

Keys leaked in repos

Credentials stored in .env committed accidentally.

Add .env to .gitignore, rotate keys, and use secrets managers.

Expired presigned URLs break workflows

Long-running jobs using stale download links.

Regenerate URLs via the REST Utilities reference (internal integrations).

Control Tool Output Sharing

When to use: Limit which agents or collaborators can see tool artifacts.

  • True — downstream agents can reuse artifacts and tables produced by the agent.

  • False — artifacts stay isolated to the producing agent.

Configure the field through agent payloads; the CLI will expose a dedicated flag in a future release.

Manage Memory Scope

When to use: Keep conversation history compliant while preserving useful context.

Use agent_config["memory"] = "mem0" to persist conversation state between runs. Share memory only when agents belong to the same account and should retain context; otherwise leave memory unset for stateless behaviour.

API Key Hygiene

When to use: Rotate, scope, and store credentials safely across teams.

  1. Issue separate keys per environment (dev/staging/production).

  2. Store keys in environment variables or secure stores (aip accounts add saves them locally under ~/.aip/config.yaml).

  3. Rotate keys regularly and revoke unused values after testing.

Presigned Artifact Management

When to use: Secure file downloads and prevent stale links from leaking data.

  • Each run response may include presigned URLs for attached artifacts.

  • If a URL expires and you need to regenerate it from an internal integration, use the REST reference only:

  • REST reference: Utilitiesarrow-up-right

  • Keep regenerated URLs short-lived and avoid sharing them broadly.

Audit Trails

When to use: Document who changed what and when for compliance or incident response.

Use run history to trace PII usage, artifact creation, and tool activity.

Python SDK:

CLI (saved locally):

Last updated

Was this helpful?