An AI coding companion from AWS, providing real-time code suggestions and security scans, with a focus on integrating with AWS services.
Note: In late 2023 and early 2024, AWS began branding its suite of AI assistants under the "Amazon Q" umbrella. Amazon CodeWhisperer's capabilities are now part of Amazon Q Developer. However, the name "CodeWhisperer" is still widely used and recognized in the developer community.
Core Competency | AWS Development, Security Scanning, License Compliance |
---|---|
Pricing Tier | Freemium |
Category | AWS Development |
Amazon CodeWhisperer excels at generating code for AWS services, leveraging its deep knowledge of AWS APIs and best practices. As an AWS-native tool, it understands the nuances of cloud development patterns and generates optimized code for various AWS services.
When working with AWS S3, CodeWhisperer can generate comprehensive code that follows AWS security best practices. Here's how it assists with a common task:
import boto3 from botocore.exceptions import ClientError import json def create_secure_s3_bucket(bucket_name, region='us-east-1'): """ Creates an S3 bucket with security best practices enabled. Includes encryption, versioning, and public access blocking. """ s3_client = boto3.client('s3', region_name=region) try: # Create bucket with location constraint if region != 'us-east-1': s3_client.create_bucket( Bucket=bucket_name, CreateBucketConfiguration={'LocationConstraint': region} ) else: s3_client.create_bucket(Bucket=bucket_name) # Enable versioning s3_client.put_bucket_versioning( Bucket=bucket_name, VersioningConfiguration={'Status': 'Enabled'} ) # Block public access s3_client.put_public_access_block( Bucket=bucket_name, PublicAccessBlockConfiguration={ 'BlockPublicAcls': True, 'IgnorePublicAcls': True, 'BlockPublicPolicy': True, 'RestrictPublicBuckets': True } ) # Enable server-side encryption s3_client.put_bucket_encryption( Bucket=bucket_name, ServerSideEncryptionConfiguration={ 'Rules': [{ 'ApplyServerSideEncryptionByDefault': { 'SSEAlgorithm': 'AES256' }, 'BucketKeyEnabled': True }] } ) return f"Secure S3 bucket '{bucket_name}' created successfully in {region}" except ClientError as e: return f"Error creating bucket: {e}"
This example demonstrates CodeWhisperer's strength in AWS development - it doesn't just generate basic API calls, but includes security best practices like encryption, versioning, and public access blocking that are essential for production AWS workloads.
Amazon CodeWhisperer includes a sophisticated reference tracking system that addresses a critical concern for enterprise development: ensuring compliance with open-source licensing requirements and avoiding potential legal issues.
When CodeWhisperer generates code suggestions, it continuously compares them against its training data to identify potential matches with open-source repositories. When a similarity is detected, the tool:
For organizations with strict compliance requirements, this feature provides essential protection against:
This transparency around code origins makes CodeWhisperer particularly valuable for enterprise environments where legal compliance is paramount, setting it apart from tools that don't provide visibility into their training data sources.
CodeWhisperer's built-in security scanning brings security analysis directly into the IDE, enabling developers to identify and fix vulnerabilities before code is committed. The tool can detect vulnerabilities from the OWASP Top 10 and other security issues across Java, Python, and JavaScript.
Consider a Python function using a weak hashing algorithm - a common security vulnerability:
import hashlib def hash_password(password): """ Hashes a user's password for storage. NOTE: This uses a weak algorithm. """ # Using MD5 is not recommended for password hashing password_bytes = password.encode('utf-8') hashed_bytes = hashlib.md5(password_bytes) # â VULNERABILITY DETECTED return hashed_bytes.hexdigest() # Example usage: user_password = "mysecretpassword123" hashed_password = hash_password(user_password) print(f"Hashed password: {hashed_password}")
CodeWhisperer Detection: The security scanner flags the use of hashlib.md5
and explains that MD5 is cryptographically broken and unsuitable for password hashing due to collision vulnerabilities.
import hashlib import os def hash_password_secure(password): """ Hashes a user's password for storage using a secure algorithm (SHA-256) with a salt. """ # Generate a random salt salt = os.urandom(32) password_bytes = password.encode('utf-8') # Combine salt and password, then hash salted_password = salt + password_bytes hashed_bytes = hashlib.sha256(salted_password) # â SECURE ALGORITHM # Store the salt with the hash return salt.hex() + ':' + hashed_bytes.hexdigest() # Example usage: user_password = "mysecretpassword123" secure_hash = hash_password_secure(user_password) print(f"Securely hashed password with salt: {secure_hash}")
CodeWhisperer's security scanning can detect various OWASP Top 10 vulnerabilities including:
This integrated approach helps developers learn secure coding practices while fixing vulnerabilities in real-time, creating a more security-aware development culture.
Amazon CodeWhisperer is an obvious choice for developers deep in the AWS ecosystem. Its suggestions are specifically optimized for AWS services, making it easier to write efficient code for Lambda, S3, and more. The inclusion of free security scanning and reference tracking for open source code is a major bonus for individuals and enterprises alike.
Amazon Q Developer (CodeWhisperer) offers specialized functionality in the AI development tools landscape. Best suited for aws development, security scanning, license compliance applications.
Developers building applications on AWS find CodeWhisperer's deep knowledge of AWS services and APIs invaluable. It generates best-practice code for services like Lambda, S3, and DynamoDB, significantly accelerating cloud-native development.
The Professional tier is purpose-built for organizations. Features like security scanning, reference tracking for open-source compliance, and integration with AWS IAM Identity Center make it ideal for businesses with strict security and governance requirements.
The free Individual Tier makes CodeWhisperer highly accessible. With only an AWS Builder ID required (not a full AWS account), it offers unlimited code suggestions and 50 security scans per month - perfect for solo developers, students, and those learning AWS best practices.
Organizations requiring strict license compliance benefit from the reference tracking feature, which identifies when suggested code resembles open-source training data and provides licensing information for informed decision-making.
Last Verified: 2025-08
Primary references: blog, docs, release notes, API, and status pages.
See how Amazon Q Developer (CodeWhisperer) stacks up against other popular AI coding assistants:
Similar tools based on category and feature overlap: