This page is a gap analysis: it maps the security controls that Kommander.ai actually implements and documents to the requirements of ISO/IEC 27001:2022 (Annex A), ISO/IEC 27017 (cloud security), and ISO/IEC 27018 (protection of PII in public clouds).

It is written so that Kommander.ai can serve as the worked example inside Gorilli’s broader Information Security Management System (ISMS). Gorilli’s ISMS — risk register, policies, management review, internal audit, and Statement of Applicability — is the system under certification; Kommander is the concrete service used to demonstrate how those controls are realised in a production cloud application.

This is a self-assessment for audit preparation, not a certification claim. Each control status reflects the state of the codebase at the time of review. Re-verify evidence before any external audit, and reconcile every “Gap” row against Gorilli’s central risk register and Statement of Applicability.

How to read this page

Each control row carries a status:

StatusMeaning
ImplementedEnforced in code/configuration, with verifiable evidence in the repository.
PartialPresent but incomplete, dependent on framework defaults, or not enforced everywhere it should be.
Documented onlyDescribed in product/security docs but relying on operational process or deployment configuration rather than application code.
GapNot present, or expected by the standard and currently missing. Drives the remediation backlog.
Org-levelOwned by Gorilli’s ISMS rather than the Kommander codebase (HR, physical, governance). Listed for completeness; evidence lives outside this repo.

Methodology

This analysis combined:

  1. Documentation review of the existing Security section (RBAC, HMAC identity, data residency, prompt-injection, compliance & audit, security operations, known limitations).
  2. Source-code verification of the load-bearing claims — authentication, session, RBAC enforcement, credential encryption, audit-log redaction, HMAC verification, consent, and DSAR handling — against the actual implementation in frontend/, backend/, and app/api/.
  3. Cloud/operations inventory across the three repositories (kommander.ai2, kommander-rag-backend, kommander-landing) for subprocessors, secrets handling, logging, CI/CD, and backup posture.

Scope of the example system

AttributeValue
ServiceKommander.ai — multi-tenant AI customer-service platform
Application stackNext.js 15, TypeScript, MongoDB, NextAuth (Auth.js v5)
RAG backendFastAPI (Python), Qdrant vector store
Role under PII regimesPII processor on behalf of customers (organizations), who are the controllers of their end-users’ data
HostingVercel (app + landing), managed PaaS (RAG backend)
Primary data storesMongoDB (incl. GridFS), Supabase storage, Qdrant
Sub-processorsOpenAI, Stripe, Resend, Inngest, Qdrant Cloud, Supabase, WhatsApp/Baileys, Bananaloop (error capture)

ISO/IEC 27001:2022 — Annex A control mapping

Annex A (2022) groups 93 controls into four themes. The tables below cover the controls that Kommander, as an application, materially exercises. Purely governance/HR/physical controls are marked Org-level and are owned by Gorilli’s ISMS.

A.5 Organizational controls

ControlTopicStatusEvidence / Notes
A.5.1Policies for information securityOrg-levelGorilli ISMS policy set; Kommander contributes the Security operating model.
A.5.7Threat intelligencePartialThreat model documented in Security Operations; no automated threat-feed ingestion.
A.5.15Access controlImplementedRBAC enforced server-side; see RBAC and A.8.3 below.
A.5.16Identity managementImplementedNextAuth identities; users + organization_members collections; platform isAdmin separated from org roles (frontend/auth.config.ts).
A.5.17Authentication informationImplementedbcrypt password hashing (cost 10), complexity policy on registration (frontend/lib/schemas/auth.schemas.ts).
A.5.18Access rights (provisioning/review)PartialMembership add/remove/role-change implemented; no scheduled access-review/recertification workflow — track at ISMS level.
A.5.19–A.5.22Supplier / cloud service relationshipsDocumented onlySub-processor list maintained (see 27018 below); DPAs / supplier security clauses are not held in-repo — Gorilli to maintain the supplier register.
A.5.23Information security for cloud servicesDocumented onlyCloud responsibility split described in Security Operations; formalised under ISO 27017 below.
A.5.24–A.5.28Incident managementDocumented onlyPublic IR procedure in Security Operations; internal runbook, on-call, and breach-notification timelines are Org-level gaps.
A.5.30ICT readiness for continuityGapNo documented RTO/RPO, DR plan, or restore-test evidence (backups rely on Atlas/Supabase managed defaults).
A.5.31Legal, statutory, regulatory requirementsDocumented onlyGDPR posture in code (consent, DSAR service); regulatory register is Org-level.
A.5.34Privacy and protection of PIIPartialConsent capture + GDPR service implemented; DSAR not self-service (see A.8 / 27018).

A.6 People controls

ControlTopicStatusEvidence / Notes
A.6.1–A.6.6Screening, terms, awareness, disciplinary, NDAsOrg-levelOwned by Gorilli HR/ISMS; not represented in the Kommander codebase.
A.6.7Remote workingOrg-levelGorilli policy.
A.6.8Information security event reportingDocumented onlyResponsible disclosure covers external reporters; internal reporting is Org-level.

A.7 Physical controls

ControlTopicStatusEvidence / Notes
A.7.1–A.7.14Physical & environmental securityOrg-levelInherited from cloud providers (Vercel, MongoDB Atlas, Supabase, Qdrant Cloud). Collect provider attestations (SOC 2 / ISO 27001 certificates) for the supplier register.

A.8 Technological controls

This is where Kommander provides the strongest, code-verifiable evidence.

ControlTopicStatusEvidence / Notes
A.8.1User endpoint devicesOrg-levelGorilli device policy.
A.8.2Privileged access rightsImplementedPlatform admin (isAdmin) is a distinct JWT/credential path from org roles; /api/admin/* requires isAdmin (app/api/admin/*).
A.8.3Information access restrictionImplementedRoutes fail closed — 401 without session, 403 without authorization. Verified across organizations, billing, conversations routes. See RBAC.
A.8.4Access to source codePartialRepos are git-managed; branch protection / code-owner enforcement is Org-level and not verified here.
A.8.5Secure authenticationPartialbcrypt + complexity + login rate-limit (10/15 min) implemented. MFA is email-OTP at signup only — not enforced per login; no TOTP. Cookie flags rely on NextAuth v5 defaults (not explicitly pinned).
A.8.6Capacity managementDocumented onlyManaged by Vercel/Atlas autoscaling; no documented capacity thresholds.
A.8.8Management of technical vulnerabilitiesPartialVulnerability-management procedure + register now in place (Gestione Vulnerabilità); 2 criticals (jspdf) remediated and verified. Still missing: Dependabot / npm audit / SCA in CI and SBOM (tracked). Lockfiles present; patch-package used.
A.8.9Configuration managementPartial.env.example documents required config; vercel.json/next.config.ts hold app config. No central config baseline doc.
A.8.10Information deletionPartialbackend/lib/gdpr.ts implements cascading delete + anonymisation across users, conversations, files, analytics, consent, billing — but it is not exposed via an API endpoint (admin-invoked only).
A.8.11Data maskingImplementedAudit-log redaction strips credentials, tokens, emails, fiscal codes, phone numbers, tax IDs, userHash, etc., before persistence (backend/lib/audit/toolAudit.ts). Connector credentials never returned in plaintext.
A.8.12Data leakage preventionPartialTool ownership filtering + identity-bound tool exposure; no DLP on bulk read/export paths, no egress monitoring.
A.8.13Information backupDocumented onlyRelies on MongoDB Atlas / Supabase managed backups; no in-repo backup policy or restore-test evidence (links to A.5.30).
A.8.15LoggingPartialTool audit logs (tool_audit_logs) with correlation IDs + redaction; error capture via Bananaloop (instrumentation.ts). No centralized SIEM, no defined log retention window.
A.8.16Monitoring activitiesGapOpenTelemetry API is imported but no tracing/metrics pipeline wired; status page (Instatus) only. No security alerting.
A.8.18Use of privileged utility programsImplementedInternal endpoints gated by INTERNAL_API_SECRET; RAG backend signs requests to the app.
A.8.20Network securityPartialTLS in transit (Vercel/HTTPS); inter-service auth via shared secrets. No private networking/VPC; all endpoints public.
A.8.21Security of network servicesPartialVercel-provided DDoS mitigation; per-route + per-auth rate limiting (MongoDB-backed) — fails open if MongoDB is unavailable.
A.8.22Segregation of networksGapApp and RAG backend communicate over public endpoints with shared-secret auth; no network segmentation.
A.8.23Web filteringN/ANot applicable to this service profile.
A.8.24Use of cryptographyImplementedAES-256-GCM for connector/identity secrets at rest with key-rotation support (backend/lib/credentials.ts, backend/lib/identitySecret.ts); HMAC-SHA-256 with constant-time compare for widget identity (backend/lib/security/hmac.ts). No formal key-management/cryptography policy document.
A.8.25Secure development life cyclePartialSecurity-relevant changes trigger doc review + security tests (HMAC, SSRF, prompt-injection); no formal SDLC policy.
A.8.26Application security requirementsImplementedFail-closed authz, signed identity, tool allow-lists, ownership checks (see Security overview).
A.8.27Secure system architectureImplementedDocumented trust boundaries and architecture diagrams in Security and Compliance & Audit.
A.8.28Secure codingPartialInput validation (zod schemas), parameterised Mongo queries, prompt-injection tests; no documented secure-coding standard.
A.8.29Security testing in developmentPartialtest:hmac, test:security, test:prompt-injection exist; Playwright visual regression disabled in CI; no DAST/penetration-test cadence.
A.8.31Separation of dev/test/prodPartialSeparate env config; shared dev secrets used locally — ensure prod uses distinct, rotated secrets per environment.
A.8.32Change managementPartialGit + PR workflow + release checklist in Security Operations; no formal change-approval record.
A.8.34Protection during audit testingDocumented onlyAudit procedure in Compliance & Audit.

ISO/IEC 27017 — cloud-specific controls

27017 extends 27001 with cloud-service guidance and adds cloud-specific controls. As a cloud service customer (of Vercel, Atlas, Qdrant, Supabase, OpenAI, Stripe) and a cloud service provider (to its own customers), Kommander has responsibilities on both sides.

27017 controlTopicStatusEvidence / Notes
CLD.6.3.1Shared roles & responsibilities in cloudDocumented onlyProvider/customer split described in Security Operations; needs a formal responsibility matrix per sub-processor.
CLD.8.1.5Removal of cloud assets on contract exitPartialAccount/org deletion + cascade exists (backend/lib/gdpr.ts); provider-side data return/erasure on exit not contractually documented.
CLD.9.5.1Segregation in virtual/multi-tenant environmentsImplementedTenant isolation via organizationId scoping + ownership checks on every data path; widget traffic scoped to widget client.
CLD.9.5.2Virtual machine hardeningOrg-levelInherited from Vercel/managed PaaS; collect provider hardening attestations.
CLD.12.1.5Administrator operational securityPartialPlatform-admin separation + audit logging; no documented admin operational procedures / break-glass process.
CLD.12.4.5Logging of cloud customer activitiesPartialTool/admin audit logs exist; no per-customer exportable activity log feature, no retention SLA.
CLD.13.1.4Alignment of network management & cloud securityGapPublic inter-service communication; see A.8.22 segregation gap.
—Data residency / region pinningGapNo per-organization residency selection; documented as a known limitation in Data Residency. Capture deployment regions per residency checklist.
—Provider certifications evidenceGapCollect SOC 2 / ISO 27001 certificates from Vercel, Atlas, Supabase, Qdrant, OpenAI, Stripe for the supplier register.

ISO/IEC 27018 — protection of PII in public clouds

27018 applies to Kommander as a PII processor. Customers (organizations) are controllers; their end-users’ conversations, uploaded documents, and identity data are the PII.

27018 areaTopicStatusEvidence / Notes
Consent & choiceLawful basis / consent captureImplementedapp/api/privacy/consent stores necessary/analytics/marketing/functional consent with timestamp, version, IP, user-agent in user_consents.
Purpose limitationProcess PII only on controller instructionDocumented onlyData-minimisation guidance for connectors/prompts in Data Residency; enforced by guidance, not technical control.
Data minimisationMinimise PII in prompts/logs/toolsPartialAudit redaction (A.8.11) strong; prompt/LLM payloads to OpenAI may contain PII without redaction.
TransparencyDisclose sub-processors & locationsPartialSub-processor list known internally; no published, versioned sub-processor list for customers.
Individual rightsAccess, rectification, erasure, portabilityPartialFull DSAR service (processDataAccessRequest, deleteUserData, exportUserDataPortable, anonymizeUserData) exists but is not exposed via a self-service or admin API endpoint — currently code-invoked only.
Retention & disposalDefined retention + secure deletionPartialRetention behaviour documented in Data Residency; retention windows not configurable per org; some deletion is manual.
AccountabilityRecords of PII processing & breach noticeGapNo formal Record of Processing Activities (ROPA); breach-notification timeline (e.g. 72h) not documented.
Encryption of PIIProtect PII in transit and at restPartialSecrets/credentials AES-256-GCM at rest; TLS in transit. Conversation/file PII at rest relies on provider-managed encryption (Atlas/Supabase defaults) — confirm and document.
Sub-processor obligationsFlow-down of PII terms to sub-processorsDocumented onlyRequires DPAs with OpenAI, Stripe, Resend, Qdrant, Supabase, Inngest — Org-level supplier register.
Return/transfer/disposalReturn or delete PII at end of servicePartialAccount deletion cascade exists; provider-side erasure on exit not documented (links to CLD.8.1.5).

Prioritized remediation backlog

Ordered by risk-to-effort for moving Kommander toward audit-ready. P1 items are the most defensible to close before an audit walkthrough.

P1 — close before audit

  1. Expose DSAR endpoints. The GDPR service (backend/lib/gdpr.ts) already implements access/export/erasure/anonymisation with cascade — wire authenticated API routes (and ideally a self-service UI) so data-subject rights are demonstrable, not just code-present. (A.8.10, 27018 individual rights)
  2. Add dependency/vulnerability scanning to CI. Enable Dependabot + npm audit/pip-audit (or Snyk) and generate an SBOM. Currently no SCA exists. (A.8.8)
  3. Document key management & cryptography policy. Algorithms, key sources, rotation cadence, and grace periods are implemented in code but not captured in a policy artifact. (A.8.24)
  4. Publish a versioned sub-processor list and assemble the supplier register (DPAs + provider SOC 2/ISO certificates). (A.5.19–A.5.23, 27017 provider certs, 27018 sub-processor obligations)
  5. Confirm and document encryption-at-rest for conversation/file PII in MongoDB Atlas and Supabase (provider settings), not just for secrets. (A.8.24, 27018 encryption)

P2 — strengthen for maturity

  1. Add security headers to the main app (CSP, HSTS, X-Frame-Options) — currently only on kommander-landing. Enforce CSP (remove unsafe-inline). (A.8.20, A.8.26)
  2. Harden rate limiting so it fails closed (or degrades safely) when MongoDB is unavailable. (A.8.21)
  3. Strengthen authentication: enforce MFA at login (TOTP), and explicitly pin session-cookie flags (httpOnly, secure, sameSite) rather than relying on framework defaults. (A.8.5)
  4. Define logging retention + centralized monitoring/alerting. Wire the OpenTelemetry API to an actual pipeline; set audit-log retention. (A.8.15, A.8.16)
  5. Document continuity: RTO/RPO, DR plan, and a periodic backup-restore test. (A.5.30, A.8.13)

P3 — defense in depth

  1. Network segregation between the app and RAG backend (private networking instead of public endpoints + shared secret). (A.8.22, CLD.13.1.4)
  2. Per-organization data residency / retention configuration. (27017 residency, 27018 retention)
  3. Access-review/recertification workflow for org members and platform admins. (A.5.18)
  4. Formal ROPA and breach-notification procedure with regulatory timelines. (27018 accountability)

Note on a corrected finding

During verification, an initial automated pass flagged “live secrets committed to the repository.” This was checked directly and is not accurate: the .env files in kommander.ai2 and kommander-rag-backend are correctly covered by .gitignore (.env* with a !.env.example exception) and have never been committed to git history. The keys exist only as local developer working-tree files, which is expected. No secret-exposure remediation is required on that basis — though P1 item on environment separation (A.8.31) still applies to ensure production uses distinct, rotated secrets.

Evidence index

Control areaPrimary evidence locations
Authenticationfrontend/auth.config.ts, frontend/lib/schemas/auth.schemas.ts, frontend/auth.actions.ts
Sessionbackend/lib/sessionService.ts, middleware.ts
RBAC / authzapp/api/**/route.ts, RBAC matrix
Cryptographybackend/lib/credentials.ts, backend/lib/identitySecret.ts, backend/lib/security/hmac.ts
Audit & redactionbackend/lib/audit/toolAudit.ts
Consent & DSARapp/api/privacy/consent/route.ts, backend/lib/gdpr.ts
Rate limitingbackend/lib/security/index.ts
Security testsbackend/lib/security/*.test.ts
Cloud / opsvercel.json, next.config.ts, instrumentation.ts, .github/workflows/*, kommander-rag-backend/