Implementing Security Best Practices

1. Managing API Keys

PracticeDetail
One key per serviceEasier rotation / audit
Rotate every 90 daysLimit exposure window
Revoke on offboardingImmediate
Use scoped keys (Enterprise)Limit by index/permission

2. Using Environment Variables

Example: Env-Driven Config

import os
pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])

3. Securing API Key Storage

StoreRecommendation
AWS Secrets ManagerBest for AWS workloads
GCP Secret ManagerBest for GCP
HashiCorp VaultMulti-cloud
.env in repoNever

4. Implementing IP Allowlisting

Note: IP allowlisting available on Enterprise plans. Configure in Pinecone console under project security.
FieldDescription
CIDR listAllowed source IP ranges
DefaultAll IPs (open)

5. Configuring Access Control

LayerMechanism
ProjectRBAC: owner / member / viewer
API keyPer-key permission scope (Enterprise)
SSO/SAMLEnterprise auth integration

6. Using HTTPS Only

Note: All Pinecone endpoints are HTTPS only; HTTP traffic is rejected.
SettingDefault
SSL verificationEnabled by default in SDKs
TLS versionTLS 1.2+ required

7. Implementing Rate Limiting

Example: Client-Side Limit

from ratelimit import limits, sleep_and_retry

@sleep_and_retry
@limits(calls=100, period=1)  # 100 calls/sec
def query(qv):
    return index.query(vector=qv, top_k=10)

8. Implementing Namespace Isolation

Warning: Namespaces are NOT a security boundary. They share the API key. For untrusted-tenant isolation, use separate indexes or projects.
GoalRight Tool
Logical separationNamespace
Data isolationSeparate index
Billing isolationSeparate project

9. Handling Sensitive Metadata

StrategyDetail
Don't store PII in metadataUse opaque IDs; lookup in DB
Encrypt at app layerIf must store
Redact text snippetsBefore embedding

10. Auditing API Access

SourceDetail
Pinecone audit logsEnterprise: API + console actions
Application logsWrap SDK calls with structured logging
SIEM ingestForward to Splunk/Datadog