Building safe-by-default tools in our Go web application
incident.io keeps tenant data isolated in a single shared database and application by making its Go code safe by default rather than relying on tests alone. An API middleware uses reflection to reject any response whose resources lack an OrganisationID or belong to a different organization. A gorm query hook fails any query or update without an organisation_id WHERE clause unless explicitly skipped. A cache interface requires an organization argument and confines unscoped access to explicit ...Global methods. The common principle is that dangerous unscoped access must be an explicit opt-in, applied at several layers because Slack traffic bypasses the API check.
Related posts
- Staying Evergreen: How we automated secure access and repo hygiene in a shared org
GitHub Engineering mediumAdeptEvergreen is a Go-based GitHub App that automates quarterly outside-collaborator access reviews and stale-repo archival in a shared org of 1,400+ GitHub employees, customers and partners, built entirely from native primitives: scheduled Actions firing repository_dispatch, webhooks, issue checklists, custom properties, and per-repo JSON state files in git that double as the audit trail. It fails secure by revoking all access when a review goes unanswered, fails closed by keeping reviews pending until every removal succeeds, and never deletes anything. Rollout relied on a DRY_RUN mode, logfmt logs in Splunk, and proactive pacing to stay under GitHub's secondary content-creation rate limits of 80 requests/minute and 500/hour.
- Rolling out Roles
incident.io mediumAdeptincident.io added role-based access control by mapping a fixed set of customer-facing roles (owner, admin, etc.) to granular internal scopes. A variadic getIdentity(ctx, requiredScopes...) check in Go puts each API's permission behind a one-line change, and generated type-safe scope enums let the TypeScript frontend gate UI such as a GatedButton. Rollout used a per-organization enforcement timestamp with a March 1st deadline and owner opt-in. Initial owners were the original installers and admins were inferred from past product usage, with owners prompted to review both.
- Better security for your app's secrets
incident.io mediumAdeptincident.io's Go app loads config from per-environment YAML files, overrides values with environment variables, then resolves `secret-manager:` references from Google Secret Manager at boot. Moving secrets out of Heroku environment variables means only a Google Service Account credential is exposed, so it can be revoked and access audited. A VPC Service Controls security perimeter with Access Levels restricts Secret Manager access to known source IPs: offices, CircleCI egress, UK/US staff locations and Heroku's AWS eu-west-1 range. The tradeoff is new availability risk, since external changes such as Heroku IP range shifts can cause outages.
- How we built enterprise search to be secure and private
Slack Engineering easyNoviceSlack's enterprise search, which brings Google Drive and GitHub results into Slack search and AI Answers, uses a federated, real-time design instead of an index. Queries go to partner search APIs at request time using per-user OAuth tokens, so no external data is stored server-side and results and permissions can't go stale. The system reuses Slack AI's model: LLMs hosted in an escrow VPC on AWS, RAG with the user's ACL rather than training on customer data, and Search Answers discarded after display. Admins and users must each opt in per source, and only read-only OAuth scopes are requested.
- A new security baseline for enterprise agentic adoption
Docker easyNoviceAgent Baseline, an open v1.0 draft from Docker, Snyk and Keycard, defines 35 controls across six security outcomes for enterprise AI agents: Discover, Constrain, Authorize, Observe, Validate and Respond. A prompt-injection scenario in a customer-support agent shows how the controls combine: default-deny network egress, short-lived task-scoped credentials that cannot be widened through delegation, a single run ID that correlates evidence, pre-deployment injection testing, and revocation with a manual fallback. The central claim is that containment should not depend on the model behaving, and that most teams already have some of these controls but lack the connections between them.