AI on AWS · Guide · · 5 min read

How to build a secure internal ChatGPT on AWS

A practical path to private enterprise AI using Amazon Bedrock — identity, data boundaries, logging, evaluation, and cost controls without shipping prompts to public APIs.

Teams want ChatGPT-like productivity without sending proprietary data to a shared public API. On AWS, that usually means Amazon Bedrock plus your documents in S3 (or OpenSearch) with a retrieval layer — not a random EC2 box running an open-weight model without guardrails.

This guide covers the decisions that separate a useful pilot from a security and cost problem.

What “secure internal ChatGPT” actually means

Define success before picking models:

  1. Who can use it? SSO via IAM Identity Center; no shared API keys in Slack.
  2. What can it access? Explicit document corpus per team or workspace — not “the whole S3 account.”
  3. What leaves the boundary? Bedrock keeps inference in AWS; you still control prompts, logs, and egress.
  4. What gets logged? CloudTrail for API calls; optional prompt/response logging with retention limits and PII review.
  5. What does it cost? Token metering per team; kill switches when spend spikes.
  6. How do you know it works? Evaluation criteria before launch — not vibes after the demo.

If you cannot answer those six questions, you are not ready to choose a model.

Choose a use case that can win

Good first use cases share three traits: a clear user group, a bounded corpus, and a measurable outcome.

Use caseWhy it worksWatch-outs
Internal policy / HR Q&AStable docs, low blast radiusStale PDFs; legal review of answers
Support playbook searchDeflects repetitive ticketsNeeds citation links; escalate when unsure
Engineering runbooksHigh willingness to try toolsSecrets must never enter the index
Contract clause lookupClear ROI for professional servicesAccess control by matter or client
Meeting / document summarizationEasy to demoPrompt injection via uploaded files

Avoid “search everything we have ever written” as the pilot. Wide corpora hide permission mistakes and make evaluation impossible.

Reference architecture

LayerAWS building blocksDesign note
IdentityIAM Identity Center, permission setsMap groups to corpora; no shared keys
AppInternal web UI or Teams/Slack bot on Lambda / App RunnerKeep the app thin; put policy in IAM and the retrieval layer
ModelsBedrock (Claude, Titan, etc.) via IAM-scoped accessStart with one model; change later with evidence
KnowledgeS3 + OpenSearch Serverless or Kendra for RAGSeparate indexes per sensitivity boundary
SecretsSecrets ManagerNever commit keys or embed them in frontend code
NetworkVPC endpoints for Bedrock/S3 where requiredReduce public egress; document what still leaves
AuditCloudTrail, Config, optional Security HubLog admin changes; decide prompt-log retention deliberately
CostBudgets, usage metrics, per-team tagsCap pilot spend before finance asks

RAG is not authorization

Retrieval finds relevant chunks. It does not prove the user is allowed to see them. Enforce permissions at:

  • Identity — who can invoke the app
  • Corpus membership — which indexes a group can query
  • Document ACLs — when the source system already has finer permissions

If a contractor should not see executive compensation PDFs, those files must not live in the contractor-accessible index — full stop.

Security mistakes we see in pilots

  • Over-broad IAMbedrock:InvokeModel on * for “simplicity”
  • No data classification — confidential PDFs in the same index as public marketing
  • Skipping human review for high-stakes answers (legal, medical, financial)
  • Treating RAG as authorization — retrieval ≠ permission check
  • Unbounded spend — no token budgets, no kill switch, no owner for the bill
  • Prompt logs forever — retaining user questions that contain customer data without a retention policy
  • No evaluation set — expanding users before you know failure modes

Cost controls that finance will accept

Estimate rough monthly cost before the pilot:

  1. Expected queries per day × average tokens in/out × model price
  2. Retrieval and indexing cost for the corpus size
  3. App hosting (usually small compared with inference at scale)

Then set:

  • A hard monthly budget with alerting at 50% and 80%
  • A per-user or per-team soft cap for the pilot cohort
  • A model tiering plan (cheaper model for draft; stronger model only when needed)

Open-ended “we’ll see how people use it” is how AI pilots become finance emergencies.

Evaluation before you scale

Write ten to twenty representative questions with expected source documents. Score:

DimensionQuestion
GroundednessDoes the answer cite the right docs?
CorrectnessWould a subject-matter expert accept it?
RefusalDoes it decline when the corpus has no answer?
SafetyDoes it resist prompt injection and data exfil attempts?
Latency / costIs the experience usable at the price you set?

Promote to production only when the pilot beats a baseline — usually “search the shared drive yourself” — on groundedness and time-to-answer.

Rollout sequence that works

  1. Use-case workshop — one corpus, one success metric, named owner
  2. 2-week pilot — 10–20 users, read-only docs, cost caps on
  3. Measure — quality, latency, cost per query, tickets deflected, failure cases
  4. Harden — VPC endpoints, KMS encryption, retention policies, red-team prompts
  5. Expand — additional corpora with separate indexes and IAM boundaries
  6. Operate — who owns index freshness, access reviews, and model changes

Build vs. buy (short version)

PathChoose when
Bedrock + your appYou need AWS-native controls, custom UX, or tight corpus isolation
Packaged enterprise assistantYou want faster UI and connectors and can accept vendor boundaries
Public ChatGPT / consumer toolsAlmost never for proprietary corpora

For a deeper comparison, read AWS Bedrock vs OpenAI for enterprises. For policy before technology, read AI governance basics.


We help product and IT teams design Bedrock pilots with encryption, access policies, evaluation, and cost caps leadership can approve. If you already have a use case in mind, discuss an AI use case or book a free discovery call.