giip
SES Proposal
AI OperationsRead-only自動化監査ログ監視TLSコストロールバック

What it takes to bring an AI-generated application to production

Published 2026-08-13 · Updated 2026-08-13 · Last Verified 2026-08-13

Answer

Once working code exists, only the feature implementation is done. Before production launch, you still need environment separation, secrets externalization, authentication and authorization, input validation and rate limiting, log masking, monitoring hooks, migration and rollback procedures, backup and recovery testing, dependency vulnerability checks, CI test and build reproducibility, deploy and rollback procedures, domain and TLS, cost caps and alerts, and operational documentation. The items most often missed are secrets externalization and rollback procedures.

Applicability of This Document

ProductAI-generated applications in general (language/framework agnostic)
Verified VersionsDesign-level explanation independent of product version (command examples assume npm 6+ / pip-audit 2.x)
EnvironmentAWS, Azure, on-premise
Required PermissionsRead access to the repository. Checking deploy configuration requires read access to each platform
Execution ImpactRead-only (the commands in this article do not change code)
RestartNot required
Last Verified2026-08-13

Ready-to-Run Commands

Detect hardcoded secretsRead-only
対象
Your organization's application repository (any language)
権限
Read access to the repository
変更作業
None (search only)
Production実行
Not applicable (run locally or in CI)
# 対象: 自組織のアプリケーションリポジトリ(言語不問)
# 権限: リポジトリの読み取り権限
# 変更作業: なし(検索のみ)
# Production 実行: 該当なし(手元またはCIで実行)

# 1) 代表的なキー名に値が直接代入されていないかを探す
#    環境変数から読んでいる行は除外して、残ったものを目視で確認する
grep -rInE "(api[_-]?key|secret|password|passwd|token|access[_-]?key)[[:space:]]*[:=]" --exclude-dir=.git --exclude-dir=node_modules --exclude-dir=vendor . | grep -vF -e "process.env" -e "os.environ" -e "getenv" -e ".example" -e ".sample"

# 2) 秘密鍵そのものが混入していないか
grep -rIn -- "-----BEGIN" --exclude-dir=.git .

# 3) 接続文字列の形(ユーザー名とパスワードが埋め込まれたURL)を探す
grep -rInE "(postgres|mysql|mongodb|redis|amqp)://[^:@/]+:[^@/]+@" --exclude-dir=.git .

# 4) 現在のコードから消しても履歴には残る。過去のコミットも確認する
git log --oneline -S "BEGIN PRIVATE KEY" | head -n 20

If even one match is found, deleting it from the code alone is not enough. Treat that key as already leaked and revoke and reissue it. Removing it from history rewrites the repository, so you need to notify collaborators beforehand.

Check dependency packages for vulnerabilitiesRead-only
対象
Node.js / Python application repository
権限
Read access to the repository and network access to the package registry
変更作業
None (audit only; no remediation commands included)
Production実行
Not applicable (run in CI or a development environment)
# 対象: Node.js / Python のアプリケーションリポジトリ
# 権限: リポジトリの読み取り権限とパッケージレジストリへの通信
# 変更作業: なし(監査のみ)
# Production 実行: 該当なし(CIまたは開発環境で実行)

# Node.js: ロックファイルを基準に既知の脆弱性を照合する
npm audit --audit-level=high

# Python: requirements もしくはインストール済み環境を監査する
pip-audit -r requirements.txt

# コンテナで配布する場合は、ベースイメージ側のパッケージも別途監査対象になる
# (アプリの依存監査だけではOSパッケージの脆弱性は検出されない)

Automatic fixes such as `npm audit fix` are not run here. A major version bump can change behavior, so apply fixes only after confirming CI tests still pass.

How to Read the Results

ColumnMeaningWhat to Check
Environment separation (Dev / Stg / Prod)Staging and production do not share the same credentials or the same databaseDevelopment machines cannot connect directly to the production database
Secrets managementKeys live in environment variables or a secrets store, not in codeA repository search turns up zero keys, including in history
Authentication and authorizationWho can log in is separated from what they can do after logging inA request specifying another user's ID is rejected (horizontal privilege check)
Input validation and rate limitingThe system does not break under unexpected input or excessive requestsType, length, and range validation exist. Unauthenticated endpoints have a request cap
Logging and maskingLogs are detailed enough to investigate, without exposing personal data or keysRequests can be traced by request ID. Passwords, tokens, and personal data are not logged
Error handling and monitoring hooksFailures are not swallowed and can be observed externallyUncaught exceptions reach a notification channel. The health endpoint reflects failures in dependencies
Migration and rollbackSchema-change apply and rollback procedures exist as a pairRollback has been run at least once in a test environment
Backup and recovery testingNot just taking backups, but confirming restoration worksThere is a record confirming the app can be restored from backup and started
Dependency vulnerabilitiesKnown vulnerabilities are identified and a response policy is decidedAudit command results are recorded, with reasons noted for anything left unaddressed
CI automated testing and build reproducibilityThe same commit always produces the same artifactLockfiles are pinned, and tests and builds pass in CI
Deploy and rollback procedureThe procedure for reverting to the previous version is documentedThere is a recorded measurement of rollback duration
Domain and TLS certificateHTTPS works on the proper domain and renewal is automatedCertificate expiry and renewal success/failure are monitored
Cost cap and alertsUnexpected charges can be noticed when they occurBudget alerts are configured and the notification channel is active
Operational documentationPeople other than the original author can start, stop, and investigate the systemStartup steps, shutdown steps, and common failure responses are documented

When to Use This

  • It works locally, but once it is time to go to production you don't know where to start
  • Production API keys are written directly into configuration files
  • The development and production environments point at the same database
  • Errors occur with no notification to anyone, and you only find out from user reports
  • Deploys work, but there is no procedure for reverting to the previous version
  • Unexpected cloud charges turn up at the end of the month

Possible Causes (Most Likely First)

  1. 01

    Generation is aimed only at "making it work"

    The instructions given to AI are usually "implement this feature," which does not include environment separation or monitoring hooks. Anything not in the instructions is not in the output, so everything beyond the feature itself tends to be systematically missing.

  2. 02

    Sample-code conventions are carried over unchanged

    Learning-material samples hardcode keys for brevity, skip error handling, and assume a single environment. Generated output can inherit these same conventions.

  3. 03

    Operational requirements were never written down

    Without defined availability targets, recovery objectives, log retention periods, and cost caps, there is no way to implement them. Without requirements, you can't even detect what's missing.

  4. 04

    There is no staging environment equivalent to production

    Without a staging environment, or with one configured differently from production, you cannot rehearse migrations or rollbacks. A procedure you have never tried will fail for the first time in production.

Diagnostic Steps

  1. 1

    Search the repository for secrets

    Read-only

    Use the grep commands above to find hardcoded keys. Treat any key you find as something to be revoked.

  2. 2

    Cross-check connection targets across environments

    Read-only

    Line up each environment's config files or environment variables and confirm that database, external API, and storage endpoints are separated per environment.

  3. 3

    Audit dependency packages

    Read-only

    Run `npm audit` or `pip-audit` and review the highest-severity findings first.

  4. 4

    Enumerate and check endpoints that require authentication

    Low

    Call each endpoint without an auth token to check for anything unintentionally exposed. Do this in a test environment.

  5. 5

    Run a migration rollback in a test environment

    Medium

    Run apply and rollback once through to confirm no data loss occurs. Do not do this in production.

  6. 6

    Restore from backup and start the app

    Medium

    Restore an existing backup into a separate environment and confirm the app starts and key operations work.

Solutions

Low-risk action that can be done immediately

  • Move keys into environment variables or a secrets store

    Medium

    Remove keys from code and read them from environment variables or a managed secrets store instead. Revoke and reissue the existing keys at the same time.

  • Separate credentials between production and staging

    Medium

    Eliminate the practice of reusing the same key in both environments. Separation keeps incidents during testing from spilling over into production.

  • Configure a notification channel for uncaught exceptions

    Low

    Fix the situation where application exceptions go nowhere. First just confirm that notifications arrive at all.

  • Set a cloud budget alert

    Low

    Make sure a notification fires when spending exceeds the expected amount. Tune the threshold over time as you operate.

Change requiring advance review

  • Separate environments into Dev / Stg / Prod

    Medium

    Separate network, credentials, and data per environment. Making Stg match production's configuration gives migration and rollback testing real meaning.

  • Define and apply a log-masking policy

    Medium

    Add shared logic that keeps passwords, tokens, and personal data out of logs. If existing logs already contain them, also decide a retention and deletion policy.

  • Pin automated tests and builds in CI

    Low

    Pin lockfiles so the same commit always produces the same artifact. If builds aren't reproducible, the artifact you'd roll back to isn't reproducible either.

  • Document the rollback procedure and measure it

    Medium

    Write the steps for reverting to the previous version, then run them in a test environment and time them.

  • Automate and monitor TLS certificate renewal

    Low

    Set up automatic renewal, then add renewal success/failure and expiry date to what you monitor. An auto-renewal setting alone won't tell you when it fails.

Change involving a restart or service impact

  • Remove keys from repository history

    High

    This rewrites history and breaks consistency with existing clones and forks. It requires collaborator agreement and dedicated time. Prioritize revoking the key and plan history removal as follow-up work.

  • Apply a schema change to the production database

    High

    Table-definition changes are hard to undo and may involve locks while running. Prepare a pre-change snapshot and rollback procedure before proceeding.

!Warnings

  • Even after deleting a key from code, treat that key as already leaked. It may remain in places the repository was shared, or in logs. Revocation and reissuance come first.
  • Migrations against the production database are hard to undo. Do not run them until a pre-change snapshot and rollback procedure are both in place.
  • Taking backups alone does not make them useful. Don't count a backup as a recovery mechanism unless you've confirmed you can restore and start from it.
  • Automatic fixes like `npm audit fix --force` can bump major versions. Apply them only after confirming CI tests still pass.
  • Meeting every item listed here does not mean failures will stop happening. The goal is not to eradicate failures, but to build a state where you notice them and can revert.

Differences by Version and Environment

When distributing via containersDependency audits for the app do not cover OS packages in the base image. Add a separate image scan.
When hosting on a managed PaaSTLS certificate renewal and platform patching can become the platform's responsibility. Confirm the line of responsibility and monitor only the scope your organization actually owns.
When running serverlessCost caps shift to being based on invocation count. Besides budget alerts, check whether you can also cap concurrent executions.

If This Doesn't Resolve It

  • Count the endpoints reachable before authentication

    Confirm there are no unauthenticated endpoints besides the health check. If there are, prioritize rate limiting and input validation.

  • Sample logs to check for leaked personal data

    Pull recent logs and confirm email addresses, phone numbers, and tokens are not being output.

  • Check the behavior when a dependent external API goes down

    Confirm the whole app doesn't become unresponsive when an external API times out.

  • Confirm certificate expiry is included in monitoring

    Having auto-renewal configured doesn't help if there's no way to notice when it fails.

  • Confirm someone other than the original operator can start and stop the system

    Hand the runbook to a different person and have them execute it, to surface assumed knowledge that was never written down.

Basis and Limitations of This Document

General technical explanation

This article is a general pre-release checklist that does not depend on any specific product. The command examples are based on the published specifications of npm and pip-audit. Only the "GIIP's scope" paragraph describes GIIP's own operational procedures, and it is not a customer case study. Figures such as time spent, reduction rates, or failure rates are not included because they cannot be verified.

FAQ

What should be done first?

Secrets externalization and environment separation. Until these two are done, later work can end up affecting production. Next comes the rollback procedure, which makes it easier to try further changes afterward.

Is it safe once I delete the key from the code?

No. It may remain in commit history, CI logs, or shared copies. Treat the key as already leaked, revoke and reissue it, then address the code and history.

Do even small apps need all three environments — Dev / Stg / Prod?

You need at least two: production and non-production. Without somewhere to rehearse migrations and rollbacks, procedural gaps only surface in production. If Stg can match production's configuration, three environments is preferable.

Can't I just have the AI write the operational code too?

It can generate things like logging and health endpoints. But decisions such as who's on call for notifications, who has approval authority, and whether a cost cap is reasonable sit outside the code. Separate what can be generated from what must be decided.

What if a large number of vulnerabilities are detected?

Address the ones that are both high-severity and reachable from outside first. You don't need to resolve everything at once, but record a reason and a re-check date for anything left unaddressed.

If I satisfy this checklist, will production be problem-free?

Not necessarily. The goal isn't to eradicate problems, but to be able to notice them and revert when they occur.

Questions This Document Covers

  • What is a productionization checklist for an AI application
  • What is missing before publishing AI-generated code to production
  • What should be checked first for AI-generated app security

What the Risk Labels Mean

  • Read-onlyDoes not change data or settings.
  • LowImpact is limited, but permissions and load should be checked.
  • MediumMay affect performance, locking, or cost.
  • HighMay cause an outage, data loss, or require recovery work.
  • Expert Review RequiredRequires a separate review before applying to production.

GIIP's Scope of Support

Your organization can carry out all of the items above without outsourcing them. The judgment call is which items to satisfy before this release and which to defer. At GIIP, when bringing an AI-generated application to production, we satisfy environment separation, secrets externalization, and a measured rollback procedure, plus a monitoring integration, before publishing. If you lack the information to prioritize, we can also help by reviewing your current setup and identifying the gaps.

Author & Technical Review

GIIP Production Operations Team

About 30 years of experience in designing, migrating, and operating large-scale web services, SQL Server, Oracle, AWS, and Azure. Experience includes 12 sets of x12large-class AWS RDS for SQL Server environments, an Oracle environment with roughly 120,000 tables, and migrating roughly 3TB from TiDB to Aurora MySQL. AI agents and human experts currently continue to monitor and operate multiple cloud databases and about 30 web services.

Related Knowledge

Related Services

Get a gap review before your production launch

If you need to repeat the same checks across multiple environments, we can discuss your entire operations setup.

Get a gap review before your production launch

← Back to Knowledge Base