Extracted from CLAUDE.md. This is the reference for system architecture.
-
deepsecure/_core/: Internal implementation modulesclient.py: High-level client services wrapping core functionalitiesbase_client.py: Base HTTP client with authenticationvault_client.py: Secret management operationsagent_client.py: Agent identity managementidentity_manager.py: Agent identity and key managementcrypto/key_manager.py: Cryptographic key operationsconfig.py: Configuration management
-
deepsecure/: Public API layerclient.py: Main SDK client (uses _core modules)commands/: CLI command implementationsintegrations/: Framework integrations (LangChain, CrewAI)resources/: Resource objects (Agent, Secret)
deeptrail-control/: Control plane (agent management, authentication, policies)deeptrail-gateway/: Data plane (API proxy with secret injection)
deepsecure.Client(public SDK) wrapsdeepsecure._core.client(internal)- Core modules handle low-level operations, public client provides clean API
- Multiple identity providers (Keyring, Kubernetes, AWS)
- Agents bootstrap identity from platform-native mechanisms
- External API calls routed through gateway with automatic secret injection
- JWT-based authentication between services
| Design Doc Pattern | Actual Pattern | Convention |
|---|---|---|
[service]/models/ |
[service]/app/models/ |
FastAPI app/ prefix |
[service]/services/ |
[service]/app/services/ |
FastAPI app/ prefix |
[service]/api/[domain]/ |
[service]/app/api/v1/endpoints/ |
Versioned, flat |
- Services: Always use
*_service.pysuffix - Validation: Use descriptive names (e.g.,
[x]_validation.py) - Constraints: Use active verbs (e.g.,
[x]_checker.py)
[service-name]/
├── app/
│ ├── api/v1/endpoints/ ← Flat, versioned API endpoints
│ ├── models/ ← SQLAlchemy/Pydantic models
│ ├── services/ ← Business logic (*_service.py)
│ ├── middleware/ ← Request/response handling
│ ├── security/ ← Security concerns
│ └── [domain]/ ← Domain modules
├── tests/
└── migrations/
| File | Purpose |
|---|---|
pyproject.toml |
Project metadata, dependencies, tool configurations |
docker-compose.yml |
Backend services orchestration |
pytest.ini |
Test configuration and markers |
Makefile |
Development workflow automation |