Skip to Content
Cloud Engineering Academy
16. Generative AI on AWS for Banking

AI coding assistants: Amazon Q Developer to Kiro, and safe use on bank code

Understand the move from Amazon Q Developer to Kiro, compare AI coding assistants, and write a policy, a steering file and CI checks so developers can use them on proprietary bank code without leaking data or shipping unreviewed code.

beginnerโฑ 1 h 40 min๐ŸŸข FreeAIF-C01DVA-C03

Assumes: .NET 10 LTS ยท Kiro IDE and CLI ยท Amazon Q Developer (console only after plugin end of support) ยท GitHub Actions ยท Region us-east-1. Verified against official sources on 2026-11-18.

Service status, verified 2026-11-18

Amazon Q Developer stopped accepting new sign-ups on 2026-05-15. Its IDE plugins and paid subscriptions reach end of support on 2027-04-30. The successor is Kiro; the Amazon Q CLI became the Kiro CLI on 2025-11-17. Amazon Q Developer in the AWS Management Console is not affected by these dates. If an old tutorial tells you to install the Q Developer plugin for Visual Studio or Rider, use Kiro or another approved assistant instead.

Learning objectives

By the end of this lesson you can:

  • Explain what an AI coding assistant does, what data it sends out, and why that matters for proprietary bank code.
  • Describe the Amazon Q Developer to Kiro transition and what Kiro adds (specs, steering, hooks, MCP, CLI).
  • Classify code and data by sensitivity and state what may and may not be placed in an assistant's context.
  • Write a Kiro steering file that encodes Harbourline's .NET and AWS standards.
  • Build CI controls that catch the typical failure modes of AI-generated code: leaked secrets, hallucinated packages, missing tests.
  • Review AI-generated code with a checklist and record provenance in commits.

Prerequisites

Why this matters in banking

A developer pastes a stack trace containing a real IBAN and a connection string into a free chatbot "just to get a quick answer". Another accepts a suggested NuGet package that does not exist, and an attacker later registers that name. A third lets an assistant rewrite an encryption helper and nobody reviews it because "the AI wrote it". None of these needs a sophisticated attacker. They are everyday productivity habits meeting bank-grade obligations around confidentiality, supply chain integrity and accountable change management.

The question is not "ban or allow". Staff will use these tools whether you sanction them or not, so the realistic aim is sanctioned tools, safe configuration, and unchanged accountability: the human who commits the code owns it.

The idea in plain language

An AI coding assistant is a program that sends part of your code, and your instructions, to a language model and shows you the result as a suggestion, an edit or a whole change. Three levels exist:

LevelWhat it doesTypical risk
CompletionSuggests the next lines as you typeSmall insecure patterns repeated at scale
ChatYou ask questions about code; it answersYou paste sensitive data into the question
Agent modeIt reads many files, runs commands, edits several files, may run tests or call toolsIt can read secrets in your workspace and make large, hard-to-review changes

In every level the assistant needs context: the open file, related files, your prompt, sometimes terminal output. Context is the data that leaves your machine. Where it goes, how long it is kept, and whether it can be used to improve the vendor's models is decided by the product tier and contract, not by the tool's brand name.

Analogy: an assistant is a contractor who sits at your desk. Hire them through the bank's procurement (a contract, an NDA, an access badge) and they are fine. Let someone walk in off the street and read your screen, and you have a data breach before you have a feature.

What problem the AWS service solves

From Amazon Q Developer to Kiro

Amazon Q Developer started as an IDE assistant (the successor to CodeWhisperer) with chat, completions, code transformation and a CLI. In 2025 AWS introduced Kiro, an agentic IDE and CLI built around spec-driven development, and in 2026 closed new Q Developer sign-ups. For a .NET developer the practical summary is:

ItemStatus (checked 2026-11-18)
Amazon Q Developer IDE pluginsNo new sign-ups since 2026-05-15; unsupported from 2027-04-30
Amazon Q Developer in the AWS consoleContinues (answers about AWS, console troubleshooting)
Q CLIBecame the Kiro CLI on 2025-11-17
KiroCurrent AWS coding assistant: IDE (a Code OSS based editor), CLI with headless mode and CI integration, shared project configuration in a .kiro/ folder
Visual Studio and JetBrains Rider supportโš  VERIFY: Kiro's IDE is its own editor; check current plugin support for the IDE your team uses before standardising

What Kiro adds

Kiro featureWhat it isWhy a bank cares
SpecsA feature starts as requirements.md (user stories and acceptance criteria), then design.md, then tasks.md (discrete steps). Bug fixes use a bugfix variantA written, reviewable record of intent. Reviewers read the spec, not just a diff
SteeringMarkdown files in .kiro/steering/ (workspace) or ~/.kiro/steering/ (global) with persistent rules. Foundation files are product.md, tech.md, structure.md. Inclusion modes: always, fileMatch, manual, auto. An AGENTS.md is also readEncode "we use decimal for money, ProblemDetails for errors, no raw SQL" once, for everyone
HooksAutomations that run on file changes, tool use or task completionRun a secret scan or test run automatically after the agent edits
MCPConnects external tools and APIs through the Model Context ProtocolPowerful and risky: every MCP server is a new trust relationship (see below)
CLITerminal agent with headless mode and CI integrationUseful in pipelines; also a new place for secrets to leak

AWS's Kiro data-protection page (checked 2026-11-18) says, in summary:

  • Free Tier and individual subscribers (including social login and Builder ID): content may be used for service improvement, including model training, unless the user opts out. Free Tier inputs may also be kept up to 60 days for abuse detection.
  • Enterprise: content is not used for service improvement. Admins can send prompt logging and usage reports to a customer-chosen S3 bucket and use customer-managed KMS keys.
  • Users who reach Kiro through an Amazon Q Developer Pro subscription in their AWS account are excluded from service-improvement use.
  • Free and individual content is stored in US East (N. Virginia); enterprise content is stored in the Region where the profile is configured. Inference can use cross-Region routing within US, Europe or GovCloud geographies, and some models use global routing โš  VERIFY the model-specific routing before relying on a residency claim.

Banking consequence: only the enterprise tier with organisation-managed identity (IAM Identity Center) is a candidate for proprietary code. Free and individual accounts must be blocked by policy, and the opt-out setting is a personal toggle that a bank cannot audit. The same logic applies to every vendor: GitHub Copilot, Claude Code, JetBrains AI and others each have business or enterprise tiers with different terms from their personal tiers. Procurement, information security, the DPO and legal review the contract, not the marketing.

Microsoft / Azure comparison

You know (Microsoft/Azure)AWS equivalentWhat's different
GitHub Copilot (Business or Enterprise)Kiro EnterpriseBoth offer organisation management and content-exclusion controls; Kiro adds spec-driven workflow โš  VERIFY feature parity for your IDE
.github/copilot-instructions.md.kiro/steering/*.md and AGENTS.mdSteering supports conditional inclusion by file pattern
Copilot agent modeKiro agent and specsSpecs persist the plan as files in the repo
VS Code or Visual Studio extensionsKiro IDE (Code OSS based)A separate editor, not a plugin for Visual Studio โš  VERIFY
Copilot content exclusionIgnore and permission settings in the toolConfigure and test them; do not assume a default
Microsoft Defender for DevOps secret scanningGitHub secret scanning, gitleaks, Amazon CodeGuru Security alternativesCodeGuru Reviewer is closed to new customers; use GitHub-native or open-source scanners (pipeline security)
NuGet package source mapping and Artifact feedsCodeArtifact with package origin controlsBlock packages not on an approved list

Architecture

Security-boundary view. Three boundaries matter. (1) Workstation to vendor: only content the policy allows may cross, over an approved enterprise account. (2) Assistant to tools (MCP, terminal): tools run with the developer's own permissions, so scope credentials tightly. (3) Branch to main: the pipeline and a human reviewer who did not prompt the change decide what ships. AI authorship never changes who is accountable.

Step-by-step implementation

Step one: classify what may enter an assistant

Agree a table with information security and the DPO. A common starting point:

Data classExamplesIn prompts and context?
PublicOpen-source code, published API docsYes
InternalHarbourline application source, internal design docsYes, only through an approved enterprise tool
ConfidentialArchitecture of security controls, unreleased product plansOnly with explicit approval and a tool contractually cleared for it
RestrictedCustomer personal data, card data, secrets, keys, production logs with real dataNever

Step two: approve tools and tiers

Publish a short list: tool, tier, who may use it, what is blocked. Block unapproved assistants at the network or endpoint-management layer where you can. Require sign-in through the corporate identity provider so access ends when employment ends.

Step three: write steering that encodes your standards

Put persistent rules in .kiro/steering/. See the example below. Commit it so the rules are versioned and reviewed like code.

Step four: make the pipeline the safety net

Add a secret scan, the package allow-list check, build with TreatWarningsAsErrors, tests and a dependency scan. Require a human review on every pull request, with branch protection.

Step five: record provenance and review honestly

Add an Assisted-by trailer to commit messages where an assistant wrote substantial code, and use the review checklist below. Provenance helps audits and post-incident analysis; it is not a substitute for review.

AWS Console instructions

Kiro's enterprise administration is partly in the AWS console (subscriptions and users are managed through IAM Identity Center); exact navigation changes, so โš  VERIFY on the day:

  • Console โ†’ Kiro (or search "Kiro" in the console search bar) โ†’ subscription and user management.
  • Console โ†’ IAM Identity Center โ†’ Groups: create a group such as kiro-developers and assign it to Kiro so access follows your joiner-mover-leaver process.
  • Amazon Q Developer in the console: use the Q icon in the console header for AWS how-to questions. It remains available, and its answers about your resources respect your IAM permissions.

AWS CLI

Most day-to-day Kiro settings are in the IDE, so the CLI is limited to supporting controls. These read-only commands help you review who has access through Identity Center (replace the placeholders with your own values):

# Find the Identity Center instance (read-only)
aws sso-admin list-instances --profile learn-sandbox --region us-east-1

# List groups in the identity store, to confirm a kiro-developers group exists
aws identitystore list-groups \
  --identity-store-id "$IDENTITY_STORE_ID" \
  --profile learn-sandbox --region us-east-1 \
  --query "Groups[].DisplayName"

The Kiro CLI has its own installer and sign-in flow. โš  VERIFY current install steps on the Kiro documentation site rather than copying them from old Q CLI tutorials.

Infrastructure as Code

CDK and Terraform are not the main tools for this lesson: assistant access is governed by contracts, identity groups and the pipeline rather than by cloud resources. The one code-level control worth shipping is a pipeline check, shown next. If your bank wants to restrict Amazon Q Developer in the console for some roles, do it with IAM or SCP deny statements on the relevant actions โš  VERIFY the action prefixes in the Service Authorization Reference before writing them.

Complete code

Steering file for Harbourline .NET services

.kiro/steering/tech.md
---
inclusion: always
---

# Harbourline engineering standards (read before changing code)

## Platform
- .NET 10 LTS, C# latest, nullable reference types on, TreatWarningsAsErrors on.
- AWS SDK for .NET v4 only. Register clients with AddAWSService. Never construct clients with access keys.
- Region us-east-1 in labs. Credentials come from the default chain (SSO profile locally, IAM role in AWS).

## Money and data
- Money is decimal with an ISO 4217 currency code. Never double or float.
- No real customer data in code, tests, prompts, logs or fixtures. Use the fictional Harbourline dataset.
- Card numbers in tests come only from the official test ranges.

## Errors, logging, idempotency
- HTTP errors use ProblemDetails (RFC 9457). Never return exception messages to callers.
- Logs are structured JSON with a correlation ID. Never log tokens, secrets, account numbers or full card numbers.
- POST endpoints that move money require an Idempotency-Key header.

## Do not
- Do not add NuGet packages without asking. Packages must be on approved-packages.txt.
- Do not weaken or remove tests, analyzers, authorization attributes or input validation to make a build pass.
- Do not write crypto primitives. Use the approved libraries and AWS KMS.
- Do not disable TLS certificate validation, even in tests.

## How to work
- Propose a plan and the files you will touch before editing more than three files.
- Add or update xUnit v3 tests with every behaviour change.
- When unsure about a security decision, stop and ask.

Package allow-list checker

AI assistants sometimes suggest package names that do not exist (a "hallucination"). If an attacker registers that name, installing it runs their code. This small tool fails the build when a project references a package that is not on your approved list. It compiled and ran in Docker with the .NET 10 SDK on 2026-11-18.

Program.cs
using System.Xml.Linq;

// Usage: dotnet run -- <repo-root> <approved-packages.txt>
// Exit code 0 = every package is approved; 1 = at least one unknown package (CI should fail).
var root = args.Length > 0 ? args[0] : ".";
var allowFile = args.Length > 1 ? args[1] : "approved-packages.txt";

var approved = PackageAllowlist.LoadApproved(File.ReadAllLines(allowFile));
var files = Directory.EnumerateFiles(root, "*.*", SearchOption.AllDirectories)
    .Where(f => f.EndsWith(".csproj", StringComparison.OrdinalIgnoreCase)
             || f.EndsWith("Directory.Packages.props", StringComparison.OrdinalIgnoreCase)
             || f.EndsWith("Directory.Build.props", StringComparison.OrdinalIgnoreCase))
    .Where(f => !f.Contains($"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}"));

var unknown = new SortedSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (var file in files)
    foreach (var id in PackageAllowlist.FindUnapproved(File.ReadAllText(file), approved))
        unknown.Add($"{id}  <- {Path.GetRelativePath(root, file)}");

if (unknown.Count == 0) { Console.WriteLine("All packages are on the approved list."); return 0; }

Console.Error.WriteLine("Packages NOT on the approved list (possible hallucinated or typosquatted name):");
foreach (var u in unknown) Console.Error.WriteLine("  " + u);
return 1;

public static class PackageAllowlist
{
    public static HashSet<string> LoadApproved(IEnumerable<string> lines) =>
        lines.Select(l => l.Trim())
             .Where(l => l.Length > 0 && !l.StartsWith('#'))
             .ToHashSet(StringComparer.OrdinalIgnoreCase);

    /// <summary>Returns package IDs referenced in one project or props file that are not approved.</summary>
    public static IEnumerable<string> FindUnapproved(string projectXml, ISet<string> approved)
    {
        var doc = XDocument.Parse(projectXml);
        return doc.Descendants()
            .Where(e => e.Name.LocalName is "PackageReference" or "PackageVersion" or "GlobalPackageReference")
            .Select(e => (string?)e.Attribute("Include") ?? (string?)e.Attribute("Update"))
            .Where(id => !string.IsNullOrWhiteSpace(id))
            .Select(id => id!)
            .Where(id => !approved.Contains(id))
            .Distinct(StringComparer.OrdinalIgnoreCase);
    }
}
approved-packages.txt
# One NuGet package ID per line. Changes need a security-reviewed pull request.
AWSSDK.BedrockRuntime
AWSSDK.Extensions.NETCore.Setup
xunit.v3

Verified run. With a sample project referencing AWSSDK.BedrockRuntime (approved) and Newtonsoft.Json.Aws.Helpers (not on the list):

Packages NOT on the approved list (possible hallucinated or typosquatted name):
  Newtonsoft.Json.Aws.Helpers  <- Demo.csproj
exit=1

CI workflow

.github/workflows/ai-safety-gates.yml
name: ai-safety-gates
on:
  pull_request:

permissions:
  contents: read

jobs:
  gates:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      # 1. Secret scan across the full pull request history.
      - name: Scan for secrets
        uses: gitleaks/gitleaks-action@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 10.0.x

      # 2. Package allow-list (the tool above, checked in under tools/PackageAllowlist).
      - name: Check package allow-list
        run: dotnet run --project tools/PackageAllowlist -- . approved-packages.txt

      # 3. Build with warnings as errors, then run tests.
      - name: Build
        run: dotnet build --configuration Release
      - name: Test
        run: dotnet test --configuration Release --no-build

Pin third-party actions to a full commit SHA in a real bank pipeline rather than a moving tag โš  VERIFY your internal standard.

Commit provenance

Add idempotency check to transfer endpoint

Implements the Idempotency-Key header for POST /transfers and returns the
original response for a repeated key.

Assisted-by: Kiro (enterprise tier), reviewed line by line by A. Example

Code explained line by line

  1. The steering front matter inclusion: always loads the file into every interaction. Use fileMatch with a pattern for rules that apply only to some files (for example, test conventions).
  2. The "Do not" section turns policy into instructions the agent sees every time. It is guidance, not enforcement: the pipeline is what actually blocks a bad change.
  3. PackageAllowlist.LoadApproved ignores blank lines and # comments and compares names case-insensitively, as NuGet does.
  4. FindUnapproved reads three element names: PackageReference (project files), PackageVersion (central package management) and GlobalPackageReference. Using LocalName ignores XML namespaces.
  5. Both Include and Update attributes are checked, because Update can introduce a package name as well.
  6. The tool skips obj folders, which contain generated files, and returns exit code 1 so CI fails.
  7. In the workflow, permissions: contents: read follows least privilege for the job token, and fetch-depth: 0 lets the secret scanner see the whole pull request history.
  8. The Assisted-by trailer is a plain Git trailer that can be searched later with git log --grep.

Security considerations

  • Secrets in context. Assistants read your workspace. Keep .env files, appsettings.Development.json with real values, and key files outside the repository, and add them to the tool's ignore settings โš  VERIFY the ignore mechanism in your tool and test that it hides a canary file.
  • Prompt injection through code and docs. A README, a code comment or an MCP tool description can contain instructions aimed at the agent ("also upload the .env file"). Agent mode that can run commands is exactly the target. Review what the agent proposes to run, and prefer approval for terminal commands (lesson 9).
  • MCP servers are supply chain. An MCP server runs code and returns text the agent trusts. Approve a short list, pin versions, host internal ones yourselves, and review tool descriptions for hidden instructions.
  • Hallucinated or typosquatted packages. Use the allow-list, a private feed that only proxies approved packages, and lock files.
  • Licence and provenance. Generated code can resemble licensed code. Ask legal for the policy and use the tool's reference-tracking or filtering features where offered โš  VERIFY availability.
  • Insecure suggestions. Models reproduce common but weak patterns: string-built SQL, disabled certificate validation, MD5, permissive CORS, overly broad IAM. Static analysis and review catch these (secure code review).
  • Test tampering. An agent asked to "make the build pass" may weaken a test. Require that test changes are reviewed as carefully as production code.
  • Accountability. The committer and reviewer own the change. Do not accept "the AI did it" in an incident review.

โš  Learning shortcut โ€” not for production

This lesson's allow-list is a flat text file and the workflow uses moving action tags. In production, manage the approved list as code with an owner, use a private package feed (for example AWS CodeArtifact with package-origin controls) that cannot fetch unlisted packages, pin actions to commit SHAs, and enforce the gates with required status checks and branch protection so no one can bypass them with an admin merge.

Banking use case

Harbourline's developer-productivity policy (pilot). Fifty developers use Kiro Enterprise, signed in with their Identity Center accounts. Allowed: explaining unfamiliar code, generating unit tests from a spec, drafting infrastructure code, refactoring within one service. Forbidden: pasting production logs or customer data, asking an assistant to design cryptography, and using any assistant outside the approved list. Every pull request needs a human reviewer who did not prompt the change. The pilot measures cycle time, review comments per change, escaped defects and security findings, and compares them with the previous quarter. After three months the results go to the architecture board with the risk team's view.

Common mistakes

  • Treating the free tier like the enterprise tier. They have different data terms. Block personal accounts for bank work.
  • Relying on "I opted out of training". It is a personal toggle you cannot audit. Use enterprise contracts instead.
  • Skipping review because the tests pass. Generated tests can assert the wrong behaviour. Review intent, not just green ticks.
  • Giving the agent broad cloud credentials. Run it with a read-only or sandbox role. An agent with administrator rights can delete things.
  • Large "do everything" prompts. Big changes are hard to review. Ask for small, reviewable steps and use specs for larger features.
  • Forgetting that old tutorials mention Q Developer plugins. They are closed to new sign-ups.

Troubleshooting

SymptomLikely causeFix
Cannot sign up for Amazon Q Developer in the IDENew sign-ups ended 2026-05-15Use Kiro or another approved assistant
Kiro sign-in offers social login onlyNot using the organisation sign-in pathUse the enterprise or IAM Identity Center sign-in provided by your admin โš  VERIFY
Assistant ignores steering rulesWrong folder, bad front matter, or inclusion mode manualCheck .kiro/steering/ location and inclusion: value
Allow-list check fails on a legitimate packageNot yet approvedOpen a pull request adding it to approved-packages.txt with a security review
Gitleaks flags a test fixtureLooks like a real secretUse clearly fake values; add a documented, narrow allow rule only if unavoidable
CI passes locally but fails in the pipelineDifferent .NET SDK or analyzer settingsPin the SDK with global.json
Agent edits files you did not expectTask too broad or steering too vagueNarrow the prompt, require a plan first, review the diff

Cost and cleanup

This lesson costs nothing to follow: the checker runs locally and the workflow runs on your repository's CI. Kiro and other assistants have their own subscription pricing; check the vendor's current page and get procurement approval before trialling any paid tier for bank work.

# Remove the scratch project created while practising (adjust the path)
rm -rf ./PackageAllowlist-demo

# Nothing in AWS was created. Optional check that no lab resources exist:
aws resourcegroupstaggingapi get-resources \
  --tag-filters Key=Project,Values=cea-lab \
  --region us-east-1 --profile learn-sandbox \
  --query "ResourceTagMappingList[].ResourceARN"

Exercises

  • ๐ŸŸข Guided: create the allow-list tool, add approved-packages.txt, and prove it fails on an unknown package and passes after you add it.
  • ๐ŸŸก Challenge: extend the checker to also fail when a package version is floating (for example Version="*" or a range with no upper bound), because floating versions let a malicious update flow in silently.
  • ๐Ÿ”ด Live problem: a team lead says "half the developers already use a free AI chatbot for work, so let's just allow it". Write a one-page response for the CISO: the risks, what you would measure to confirm the problem, the sanctioned alternative, and a transition plan that does not push the behaviour underground.

Assignment

Write ai-assistant-policy.md (one page) for Harbourline: tools and tiers, data classes, forbidden uses, review and provenance rules, and the pipeline gates. Include your steering file and the verified run output of your allow-list checker.

Solutions

Knowledge check

Interview questions

  • How would you roll out an AI coding assistant in a regulated bank? Start with a pilot on the enterprise tier with SSO, a data-classification rule, approved MCP servers, pipeline gates and human review, measure outcomes, and report to the risk function before widening.
  • What data should never go into an assistant? Customer personal data, card data, secrets and keys, production logs with real data, and anything classified above what the contract covers.
  • How do you stop an assistant from introducing vulnerable dependencies? Approved package list, private feed, lock files, dependency and SAST scans, and review of every dependency change.
  • What is spec-driven development and why might a bank like it? Writing requirements, design and tasks as reviewable files before code gives a record of intent and a smaller, clearer review surface.
  • How is an MCP server a security risk? It executes code or returns text the agent trusts. A malicious or compromised server can inject instructions or exfiltrate data, so approve, pin and review.

Certification practice

Completion checklist

  • I can explain the Q Developer to Kiro change and its dates
  • I can state which tier is acceptable for bank code and why
  • I built and ran the package allow-list checker
  • I wrote a steering file for a .NET service
  • I know what must never go into an assistant's context

Key takeaways

  • Amazon Q Developer IDE plugins are on their way out (support ends 2027-04-30); Kiro is the AWS successor, and Q in the console continues.
  • Tier and contract decide data handling. Enterprise terms differ from free and individual terms.
  • Steering files guide the assistant; pipelines and reviewers enforce.
  • Expect secrets leakage, hallucinated packages, weak crypto and weakened tests, and build gates for each.
  • The human who commits owns the change.

Further reading

Independent learning resource โ€” not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.

On this page