Security & Compliance
Rusakov Shield posture — sealed environment, response sanitization, and SOC 2 / HIPAA / ABA 1.6 compliance.
Rusakov Shield — CleverCase Tenant Operator Guide
CleverCase runs under the Rusakov Shield layer. This guide is the tenant-facing reference for the shield posture, how to verify it, and the contracts agents and developers must respect. The canonical posture is declared in packages/rak-plugin-clevercase/rak-plugin.json (shield and compliance blocks) and resolved by the platform.
Posture at a glance
| Aspect | Value | Source |
|---|---|---|
| Surfaces | worker, gateway, mcp, sdk | shield.surfaces |
| Sealed keys | DATABASE_URL, LEGACY_DATABASE_URL, HEROKU_DATABASE_URL, REDIS_AI_URL, RAK_GATEWAY_SERVICE_KEY, RAKONTEVR_SERVICE_KEY, JWT_SECRET, AWS_SECRET_ACCESS_KEY, OPENAI_API_KEY | shield.sealedKeys |
| Response sanitization | enabled | shield.sanitizeResponses |
| Source map stripping | enabled | shield.stripSourceMaps |
| Compliance standards | SOC 2, HIPAA, ABA 1.6 | compliance.standards |
| Data classification | legal-privileged | compliance.dataClassification |
| Retention | 2555 days (7 years), incl. PHI | compliance.retentionPolicy |
| PII scan before cloud offload | required | compliance.requireNimPiiScan, cloudOffloadRequiresMasking |
The four shield guarantees
1. Sealed environment
Keys in shield.sealedKeys are encrypted in memory at worker boot via the platform sealed-env bootstrap. They are key names only in the manifest — never values. Agents and code MUST NOT:
- log or echo sealed values (no
console.log(process.env.DATABASE_URL)), - return them in API responses or error messages,
- add new env keys with secret values to
rak-plugin.json.
The CleverCase secrets toolchain enforces this at the source: secrets live only under rakontevr/clients/clevercase/* and the namespace guard in scripts/secrets/clevercase-secrets.manifest.sh aborts on any out-of-namespace id.
2. Response sanitization
Any customer-facing API route returning data to client users must pass through the platform sanitizeApiResponse() (rusakov-shield/response-sanitizer). Sanitized payloads must not contain:
executionPath, provider names, orchestration traces, internal model ids,- internal stack traces or sealed key names,
- cross-firm matter content (see MSO content-blind rule below).
CleverCase API handlers are wrapped with withCleverCaseTracing (packages/rak-plugin-clevercase/src/api/trace.ts) which feeds the platform sanitizer.
3. MSO content-blind isolation (ABA 5.4)
MSO admin / rollup APIs return counts and billing aggregates only. Firm A cannot see Firm B matter content. Enforced by:
- RLS on
clevercase_*tables (migrations 043, 044,rak_rls_row_ok_uuid), requireManagementRolegating in MSO handlers,- the RBAC matrix in
src/rules/policies/generated-bundle-policies.ts, - tests in
packages/rak-plugin-clevercase/src/__tests__/mso-rbac.bdd.test.ts.
4. Container hardening
Client-facing images are compiled bundles only — no source maps, no .cursor/rules, no platform source, no internal docs.
Verify the posture
clevercase shield status # delegates to rak security shield (tenant env)
clevercase shield audit # full posture auditNote: in this standalone repo, clevercase blocks platform-operator security subcommands; shield status/audit are the allowed tenant verbs (clevercase shield status|audit → rak security shield … --tenant clevercase). Other shield operations are platform-operator only.
Known platform issue (2026-06):
rak security shield statuscurrently fails withERR_MODULE_NOT_FOUNDforrusakov-shield/agent-shield(missing module imported bygateway-shield.ts). The CleverCase wiring is correct; this is a platform-side bug tracked separately. Until fixed, verify posture via the manifest test suite (shield-compliance.bdd.test.ts).
Compliance + secrets checks:
clevercase secrets validate # required keys present, tenant id matches
./scripts/aws/setup-aws-profile.sh --verify-only # IAM isolation check
npm run test # includes shield/RBAC/secrets BDD testsAgent rules (must / must not)
MUST
- Treat all matter data as
legal-privileged; never log PHI or client narratives. - Route customer-facing responses through
sanitizeApiResponse(). - Keep MSO views content-blind (counts/aggregates only).
- Mask PII before any cloud offload (
requireNimPiiScan). - Keep secrets within
rakontevr/clients/clevercase/*.
MUST NOT
- Disable sanitization, sealed-env, or PII-scan flags to pass a check.
- Store secret values in
rak-plugin.json, rules, or source. - Expose cross-firm matter content to MSO admins or parent tenants.
- Bypass auth for secrets pull, MSO routes, or tenant-scoped MCP tools.
Related
packages/cursor-plugin-clevercase/rules/clevercase-shield.mdcpackages/cursor-plugin-clevercase/rules/clevercase-compliance.mdcCLEVERCASE-ONBOARDING.md— AWS profile + secrets isolation- Platform architecture:
docs/architecture/RUSAKOV-SHIELD.md(rakontevr monorepo)