Abstract
This publication covers modern IBM i development practices including RPG modernization with free-format syntax and ILE modularity, data-centric programming with SQL table definition and database design, database re-engineering strategies, character encoding and CCSID fundamentals, test-driven development with automation, and performance optimization tools for Db2 for i. The content addresses developers and technical professionals working with IBM i systems, providing practical guidance on modernizing legacy applications, implementing data-centric architectures, ensuring proper character encoding, establishing automated testing frameworks, and optimizing database performance through systematic analysis and index management.
Authors
Tim Rowe, Brad Bentley, Steve Bradshaw, Jim Buck, Andrew Clark, Andrew Youens, Scott Forstie, Ludovic Gasc, Shankar Giduturi, Wim Jongman, Sébastien Julliand, Gaurav Kumar, Marius le Roux, Benoit Marolleau, Kent Milligan, Ryan Moeller, Rahul Pareek, Het Patel, Michael Pavlak, Pascal Polverini, Marina Schwenk, Vikas Sonwal, Todd Stewart, Jeff Ticker, Khushi Wadhwa, Carol Woodbury, Jia Tian Zhong and George Van Eaton
- Authors and Contributors
- An introduction to modernizing IBM i applications
- Path to modernization
- Modern architecture
- Development tools
- Interfacing
- User interface
- Modern RPG
- Data-centric development
- Database re-engineering
- Open source
- Web serving
- Security
- Globalization
- Source control
- DevOps
- AI and IBM Bob
- What is AI for IBM i Modernization?
- What Is Bob?
- How to Use Bob for Code Analysis
- How do I use IBM Bob for documentation?
- What are AI-Assisted Development Tools?
- Different AI Assistants and IBM BOB with RPG
- What is AI-Powered Testing?
- How to Implement AI Testing Tools for IBM i Applications
- What Are AI Code Review Tools?
- How to Integrate AI into IBM i Development Workflows
- How to Decide When to Use AI Tools for IBM i Development
- How to Choose AI Tools for IBM i Development
- What are the Security Best Practices when Using AI?
- What are Security Best Practices when Developing AI Agents?
- Why Use MCP to Interface AI with IBM i
- Should I care about testing AI?
- Using Sample Prompts to Get Better Results from IBM Bob
- Test-driven development with Automation
- Performance
AI and IBM Bob
What is AI for IBM i Modernization?
This section introduces how Artificial Intelligence (AI) is transforming IBM i application modernization. You'll learn what AI means in the context of IBM i, why it's becoming essential for modernization efforts, and how AI-powered tools like IBM Bob are changing the way developers work with legacy systems.
What It Is
AI for IBM i modernization refers to the application of artificial intelligence technologies-including large language models (LLMs), natural language processing (NLP), and machine learning-to assist developers in understanding, maintaining, and transforming IBM i applications. These AI-powered tools act as intelligent assistants that can:
- Understand legacy code written in RPG, COBOL, CL, and DDS
- Explain complex business logic embedded in decades-old programs
- Generate modern code following current best practices
- Analyze database schemas and suggest optimizations
- Generate documentation creation and maintenance
- Assist with code refactoring from fixed-form to free-form
- Provide contextual guidance based on IBM i-specific knowledge
Unlike traditional development tools that require exact syntax and commands, AI tools understand natural language requests and can interpret intent, making them accessible to both experienced IBM i developers and those new to the platform.
Why It Matters
IBM i systems power critical business operations across industries, with many applications running code written 20-40 years ago. Organizations face several modernization challenges:
- Skills Gap: Experienced RPG and COBOL developers are retiring, and fewer new developers are learning these languages
- Knowledge Transfer: Business logic is often undocumented and exists only in the code itself
- Technical Debt: Legacy code patterns make maintenance costly and risky
- Modernization Pressure: Businesses need to integrate with modern technologies, APIs, and cloud services
- Time Constraints: Manual code analysis and refactoring is time-consuming and error-prone
AI addresses these challenges by:
- Accelerating understanding of unfamiliar codebases
- Reducing learning curves for new developers
- Automating repetitive tasks like code conversion and documentation
- Preserving institutional knowledge by extracting and documenting business logic
- Enabling incremental modernization with AI-assisted refactoring
- Improving code quality through AI-powered analysis and suggestions
How It Works
AI for IBM i modernization typically operates through several key mechanisms:
1. Context-Aware Analysis
AI models are trained on vast amounts of code and documentation, including IBM i-specific languages and patterns. When you provide code or ask a question, the AI:
- Analyzes the syntax and structure
- Identifies patterns and relationships
- Accesses relevant IBM i documentation and best practices
- Generates contextually appropriate responses
2. Natural Language Interface
Instead of memorizing complex commands, developers can:
- Ask questions in plain English: "Explain what this RPG program does"
- Request specific actions: "Convert this fixed-form RPG to free-form"
- Get guidance: "How do I optimize this SQL query for Db2 for i?"
3. Code Generation and Transformation
AI can generate or transform code by:
- Understanding the intent behind legacy code
- Applying modern coding patterns and best practices
- Maintaining business logic while improving structure
- Generating test cases and documentation
Important: Developers remain fully responsible for all code in their applications. AI-generated code is a suggestion that must be reviewed, tested, and approved by the developer before use. The developer owns the final code, not the AI.
4. Continuous Learning
Modern AI tools can:
- Learn from your codebase and coding patterns
- Adapt suggestions to your organization's standards
- Improve recommendations based on feedback
- Stay updated with latest IBM i features and best practices
5. Integration with Development Workflow
AI tools integrate directly into:
- IBM Bob, VS Code and other IDEs
- Command-line interfaces
- CI/CD pipelines
- Code review processes
Key Takeaways
- AI for IBM i modernization uses advanced language models to understand, explain, and transform legacy IBM i code, making modernization faster and more accessible
- It addresses critical challenges including the skills gap, knowledge transfer, and technical debt by acting as an intelligent assistant for developers at all experience levels
- AI tools work through natural language interfaces, eliminating the need to memorize complex syntax while providing context-aware analysis, code generation, and continuous learning capabilities
- This technology enables incremental modernization by automating repetitive tasks, preserving business logic, and helping organizations maintain their IBM i investments while adopting modern development practices
- IBM Bob is a leading example of AI-powered assistance specifically designed for IBM i developers, offering specialized knowledge in RPG, COBOL, CL, Db2 for i, and IBM i system services and apllications
What Is Bob?
This topic explains Bob and its role as an AI-powered enterprise development partner. It focuses on how Bob supports legacy modernization, regulated environments, and large-scale re-platforming programs. You will learn how Bob differs from traditional AI coding tools and how its core model—based on Modes, Tools, Skills, and Workflows—enables enterprise-grade development and transformation.
What It Is
Bob is an AI-powered software development partner that continuously learns your enterprise environment. Unlike code completion tools or prompt-driven assistants that operate on isolated inputs, Bob builds a persistent understanding of your systems. It reads entire repositories, analyzes dependencies, infers coding patterns, and applies that knowledge across design, development, testing, and deployment.
This means Bob is not reacting to a single prompt. It operates with awareness of your architecture, your standards, and how your applications behave as a system. It understands relationships between programs, data structures, and workflows, allowing it to provide guidance that reflects how your organization actually builds and maintains software.
Bob is particularly effective in enterprise environments where systems are complex, long-lived, and tightly integrated. This includes IBM i and RPG-based applications, where business logic is often distributed across programs and data structures. By maintaining system-level awareness, Bob enables teams to move faster while reducing the risk of unintended impact.
Why It Matters
Traditional AI coding tools are limited by context. They generate suggestions based only on what is visible in the current file or prompt. In enterprise systems, this creates risk. Changes made in isolation can introduce defects, break dependencies, or violate standards enforced elsewhere in the system.
Bob addresses this limitation by operating with system-wide awareness. It understands dependencies, architecture, and standards, allowing teams to make changes with confidence. This is especially important in modernization efforts, where applications are refactored, transformed, or re-platformed.
For example, converting RPG fixed-format code to modern free-form requires more than syntax changes. It requires understanding program structure, file usage, and execution flow. Bob evaluates these relationships, recommends appropriate transformations, and ensures alignment with organizational standards.
The result is reduced rework, faster delivery, and higher-quality code. Just as important, quality shifts earlier in the development lifecycle, reducing reliance on post-development review.
How It Works
Bob combines contextual intelligence with structured execution through a simplified and evolving model built around Modes, Tools, Skills, and Workflows.
Layers of Intelligence
Bob builds and applies knowledge through three core layers:
- Learning Your Intent
Bob interprets user requests within the context of development tasks such as planning, coding, testing, and modernization. Rather than treating requests as isolated prompts, it aligns them with system-level understanding. - Learning Your Codebase
Bob reads and analyzes full repositories to understand application structure, dependencies, and patterns. This enables it to evaluate how changes impact the broader system. - Learning Your Standards
Organizational standards can be defined in.MD files and are applied during design, development, and review. Bob also learns patterns from existing code to ensure consistency and compliance.
Modes – Plan and Develop
Bob operates using a simplified mode structure centered on two primary modes:
- Plan Mode – Focused on analysis, design, and understanding. This includes activities such as code analysis, impact analysis, and architectural planning.
- Develop Mode – Focused on implementation, including code generation, refactoring, testing, and modernization.
This model replaces earlier multi-mode approaches and provides a streamlined experience across the development lifecycle.
Tools – System Interaction Layer
Tools are the execution layer that allow Bob to interact directly with IBM i systems. They enable Bob to move from analysis to action.
File System Tools
- QSYS Read, Write, Delete File
- IFS Read, Write, Delete File
Execution Tools
- Call CL Commands (including compilation)
- Call PASE Commands
- Run SQL Scripts
Language Parsers
- RPGLE Parser
- CL Parser
- DDS Parser
These tools improve the user experience by allowing Bob to perform real system actions—such as reading source, compiling programs, and executing SQL—rather than only generating suggestions.
Skills – Core Execution Model
Skills are the primary mechanism Bob uses to perform tasks. Most capabilities that were previously exposed as commands are now implemented as Skills.
Each Skill represents a reusable unit of work, such as:
- Refactoring variables for readability
- Converting fixed-format RPG to free-form
- Removing unused or dead code
- Generating test suites or documentation
Skills can be directly invoked by the user or automatically selected by Bob based on the request. Some Skills may be visible and selectable, while others operate behind the scenes as part of larger processes.
Workflows – Guided, Multi-Step Execution
Workflows orchestrate multiple Skills to complete complex tasks that require decision points and interaction.
For example, converting an RPG program to modern free-form may involve:
- Determining whether the program is OPM or ILE
- Identifying cycle processing
- Detecting file definitions and dependencies
- Prompting for decisions such as file placement or structure
Workflows guide the user through these steps, ensuring the correct sequence of actions is applied. This allows Bob to handle complex transformations in a controlled and predictable way.
Workflows represent a shift from single-action execution to guided problem solving, making them a key capability for enterprise modernization.
Key Takeaways
- Bob is an AI-powered development partner that learns enterprise systems over time.
- It operates with system-wide awareness, reducing risk in complex environments.
- Uses simplified modes (Plan and Develop) aligned to the development lifecycle.
- Tools enable direct interaction with IBM i systems for real execution.
- Skills replace command-based interactions and provide reusable capabilities.
- Workflows orchestrate complex, multi-step tasks with decision points.
- Enables safe, scalable modernization, especially for IBM i and RPG applications.
- Improves efficiency, reduces rework, and increases overall code quality.
How to Use Bob for Code Analysis
What is AI Code Analysis
AI code analysis is the use of artificial intelligence to evaluate source code for quality, performance, security, and maintainability. Unlike traditional static analysis tools that rely on predefined rules, AI-driven analysis understands patterns, context, and developer intent. It identifies not only syntax errors, but also deeper issues such as inefficient logic, duplication, and structural weaknesses.
In IBM i environments, AI code analysis applies to RPG, CL, and SQL programs, where complex business logic and long-lived applications are common. AI models are trained on large codebases and best practices, enabling recommendations that reflect real-world development patterns. This allows developers to receive guidance similar to an experienced reviewer, delivered consistently and in real time.
Bob brings AI code analysis directly into the development workflow, shifting teams from reactive debugging to proactive quality improvement.
Why it Matters
The quality of enterprise code directly impacts system reliability, maintainability, and business continuity. Manual code reviews are valuable but often inconsistent and time-consuming. In IBM i environments, where RPG and CL applications frequently support critical operations, even small inefficiencies or defects can create significant downstream impact.
Bob provides a consistent and scalable approach to code analysis. It identifies defects early, highlights performance issues, and enforces coding standards across the team. This reduces rework, shortens feedback cycles, and improves overall delivery quality.
Bob also strengthens long-term maintainability. By analyzing complexity, dependencies, and duplication, it surfaces areas that require refactoring. This is especially important in legacy systems where knowledge may be limited or fragmented.
Another important factor is how developers interact with Bob. Because Bob is AI-driven, the quality of the prompt directly influences the quality of the analysis. Clear and specific prompts produce targeted and actionable recommendations, while vague prompts result in general feedback. Effective prompting allows teams to guide Bob toward performance tuning, refactoring, or impact analysis.
For organizations adopting modern practices such as DevOps and CI/CD, Bob ensures that IBM i applications are included in automated quality gates. This allows legacy and modern systems to evolve together without sacrificing standards or stability.
How it Works
Using Bob for code analysis combines full-repository awareness with AI-driven analysis using a unified mode, skills, and workflows. This approach enables developers to move from simple code inspection to guided, intelligent problem-solving.
1. Setup and Configuration
Load your entire repository into the Bob workspace to maximize the effectiveness of AI-driven analysis. Bob delivers the most accurate and valuable insights when it has full visibility into your codebase, including cross-program dependencies, shared structures, and database interactions.
During code analysis, Bob examines the entire repository—not just individual programs—to ensure it has all necessary context. This includes relationships between programs, files, fields, and database objects. Without full repository visibility, analysis results may be incomplete or lack accuracy.
After loading the repository:
- Connect Bob to IBM i source libraries or version control systems
- Define analysis scope
- Configure coding standards and performance rules
- Apply organizational security and maintainability policies
This configuration ensures Bob aligns with enterprise development standards.
2. Select Analysis Approach (Mode, Skills, and Workflows)
Bob operates using a single unified mode that combines analysis, development, and modernization capabilities into one experience. Instead of switching between multiple modes, developers interact within one environment and use skills and workflows to perform specific tasks.
Single Developer Mode
The unified Developer mode supports:
- Code analysis and understanding
- Code modification and refactoring
- Impact analysis and dependency tracing
- Modernization and transformation activities
This simplifies the user experience and removes the need to switch contexts.
Skills (Task Execution)
Skills are the primary way to perform actions in Bob. They replace traditional commands and represent specific, reusable capabilities.
Examples of skills include:
- Refactor code for readability
- Analyze variable usage
- Identify performance issues
- Trace field-level dependencies
Skills may be:
- Visible – selectable by developers
- Hidden – automatically used by Bob during analysis
Workflows (Guided Execution)
Workflows provide structured, multi-step interactions to solve complex problems. They guide developers through decision points and apply the appropriate skills at each step.
Workflows are especially useful for:
- Code modernization
- RPG to SQL transformations
- Handling OPM vs ILE program differences
- Managing conditional logic and design decisions
Example workflow behavior:
- Detect a cycle-based RPG program
- Prompt for transformation decisions
- Guide file and structure creation
- Execute skills to complete the process
How They Work Together
- Mode provides the unified working environment
- Skills execute individual tasks
- Workflows coordinate multi-step processes
For effective code analysis:
- Use skills for targeted analysis tasks
- Use workflows for complex or multi-step scenarios
- Use clear prompts to guide Bob toward desired outcomes
This model replaces earlier multi-mode and command-based approaches.
3. Code Scanning
Once the analysis approach is defined, initiate a scan. Bob parses source code and evaluates it within the unified Developer mode.
- Analysis and understanding occur within the single mode
- Skills and workflows determine how analysis is executed
Because Bob evaluates the full repository context during scanning, it can correlate changes across programs, detect hidden dependencies, and provide more accurate recommendations than isolated file analysis.
Prompting plays a critical role at this stage. Clearly define what you want Bob to analyze.
Examples:
- Identify performance issues in this RPG program
- Analyze downstream impact of changing this field
- Recommend modernization improvements for this module
The better the prompt, the better the results.
4. Analysis and Recommendations
Bob generates detailed recommendations aligned with the selected skills and workflows.
Typical recommendations include:
- Simplifying complex or nested logic
- Refactoring duplicated or tightly coupled code
- Improving readability and maintainability
- Identifying potential runtime risks
- Highlighting modernization opportunities
Each recommendation includes context and explanation so developers understand both the issue and the suggested improvement.
5. Reporting and Visualization
Bob produces structured reports that summarize findings and highlight areas of concern.
Common metrics include:
- Code complexity
- Duplication levels
- Dependency relationships
- Modernization opportunities
These reports provide visibility to development teams and leadership, helping prioritize improvements.
6. Integration with Development Workflow
Bob integrates with development pipelines and version control systems.
Code analysis can occur during:
- Code commits
- Pull requests
- Build processes
- Release validation
This ensures continuous quality enforcement throughout the development lifecycle.
7. Iterative Improvement
Bob improves over time through continuous use and feedback.
Teams can:
- Refine analysis rules
- Adjust thresholds
- Update coding standards
- Align recommendations with internal policies
This ensures Bob evolves alongside the organization.
Bob Capability Levels (Base and Premium)
Bob provides different capability levels depending on deployment and licensing.
Base Capabilities
- Core AI-driven code analysis
- Unified Developer mode
- Skills for task execution
- Basic workflow support
- Code quality and maintainability recommendations
Premium Capabilities
- Native connectors for direct IBM i integration
- Advanced workflows for modernization and transformation
- Deeper repository-wide analysis
- Enhanced scalability for large codebases
- Expanded automation capabilities
Premium capabilities are designed for enterprise-scale modernization and complex system analysis.
Key Takeaways
- AI code analysis provides deeper insight than traditional rule-based tools
- Bob examines the entire repository for accurate and complete analysis
- Full repository visibility significantly improves results
- A single unified mode simplifies the developer experience
- Skills replace commands and execute specific tasks
- Workflows guide complex, multi-step processes
- The quality of prompts directly impacts the effectiveness of analysis
- Integration into development workflows enables continuous quality enforcement
- Bob supports both modernization and long-term sustainability of IBM i applications
How do I use IBM Bob for documentation?
IBM Bob is an analysis-driven documentation capability for IBM i environments. It generates technical documentation directly from source code by first building an accurate understanding of how a system works. Instead of relying on manually written descriptions—which are often incomplete or outdated—Bob reads programs, service programs, and dependencies to construct a model of actual system behavior.
From this model, Bob produces multiple forms of documentation:
- Program headers describing purpose, parameters, and dependencies
- Procedure-level documentation explaining inputs, outputs, and logic
- Architecture documentation showing how components interact
Outputs can be formatted for inline source comments, markdown, or formal technical documents. The key principle is simple: documentation is generated from verified understanding, not written from assumption.
Why It Matters
Documentation gaps are common in IBM i systems. Over time, complexity increases while documentation becomes outdated or disappears entirely. This creates a gap between what the system does and what teams understand.
That gap leads to:
- Slow onboarding for new developers
- Increased time spent reverse-engineering code
- Higher risk when making changes
- Dependency on a small number of experienced developers
IBM Bob reduces this risk by making documentation faster, more accurate, and repeatable.
- Accuracy improves because documentation is derived from source code
- Speed increases by replacing manual analysis with automated understanding
- Consistency is enforced through structured prompts and workflows
- Modernization is enabled with clear visibility into system behavior
The result is a practical shift: documentation becomes part of the development process instead of an afterthought.
How It Works
IBM Bob follows a structured, iterative workflow.
1. Establish Context
Load relevant source members. This may include a single RPG program, a service program with prototypes, or multiple components for broader analysis.
2. Analyze First
Prompt Bob to analyze the code before requesting documentation. Focus on:
- Program purpose
- Key procedures and logic
- File and database dependencies
- Data flow and error handling
This creates the foundation for accurate output.
3. Validate the Analysis
Review the results. Correct any missing or incorrect interpretations. This step ensures the model is reliable.
4. Generate Documentation in Sections
Produce documentation in logical parts:
- Program header
- Procedure documentation
- Usage or interface details
- Architecture summary
This improves clarity and review quality.
5. Review and Format
Refine each section and specify the output format (comments, markdown, or prose). First-pass output should always be treated as a draft.
Hands-On: Generating Documentation with IBM Bob
The following example shows how to document an RPG program.
Scenario: Generate a program header and procedure documentation for an existing RPG program.
Step 1: Load the Source
Provide the RPG source member to Bob. If applicable, include related prototypes or copybooks.
Step 2: Run Analysis Prompt
Start with analysis, not documentation.
Example prompt:
"Analyze this RPG program. Summarize its purpose, key procedures, file dependencies, and error handling."
Step 3: Validate Output
Review the response:
- Does the purpose match expectations?
- Are all files and dependencies identified?
- Are key procedures correctly described?
Refine with follow-up prompts if needed.
Step 4: Generate Program Header
Once validated, request the header.
Example prompt:
"Generate a standard IBM i program header including purpose, parameters, and dependencies based on the validated analysis."
Step 5: Generate Procedure Documentation
Next, document procedures.
Example prompt:
"Document the procedures in this program, including inputs, outputs, and processing logic."
Step 6: Review and Insert
Review the generated documentation. Adjust wording or structure as needed, then insert into the source or publish to your documentation platform.
Common Mistakes to Avoid
- Skipping the analysis step
- Requesting all documentation in a single prompt
- Not validating dependencies or logic
- Using vague prompts that produce generic output
Key Takeaways
- Start with analysis, not documentation — understanding the code is the foundation of accurate output.
- Use structured, repeatable steps — load, analyze, validate, generate, and refine.
- Generate documentation in sections — smaller outputs improve clarity and review quality.
- Validate everything — IBM Bob accelerates the process but does not replace engineering judgment.
- Standardize prompts and formats — consistency across teams improves long-term maintainability.
- Integrate documentation into development — the best time to document is during active development or modernization.
IBM Bob transforms documentation from a manual, inconsistent task into a structured engineering process. When used correctly, it closes the gap between code and understanding, enabling teams to maintain and evolve IBM i systems with greater speed and confidence.
What are AI-Assisted Development Tools?
This section explores AI-assisted development tools in the context of IBM i modernization. You'll learn how these tools differ from traditional development environments, understand their core capabilities, and discover how they integrate into existing IBM i development workflows to accelerate modernization efforts.
What It Is
AI-assisted development tools are intelligent software applications that leverage artificial intelligence-particularly large language models (LLMs) and machine learning-to augment developer capabilities throughout the software development lifecycle. Unlike traditional IDEs that provide syntax highlighting and code completion based on predefined rules, AI-assisted tools understand context, intent, and semantics to provide intelligent assistance.
For IBM i development, these tools represent a paradigm shift. Traditional IBM i development tools like SEU (Source Entry Utility), PDM (Programming Development Manager), and even modern IDEs like RDi (Rational Developer for i) operate primarily on syntax rules and predefined templates. AI-assisted tools go further by:
-
Understanding Legacy Code Patterns: They can analyze decades-old RPG III fixed-format code and explain its business logic in plain language, even when documentation is sparse or non-existent.
-
Contextual Code Generation: Rather than simple templates, they generate code based on natural language descriptions while adhering to IBM i-specific constraints, such as field length limitations, EBCDIC considerations, and platform-specific APIs.
-
Intelligent Refactoring: They can transform fixed-format RPG to free-form while preserving business logic, suggest modern alternatives to native I/O operations using embedded SQL, and recommend performance optimizations specific to Db2 for i.
-
Cross-Language Understanding: They comprehend relationships between RPG programs, CL scripts, DDS definitions, and SQL procedures, enabling holistic analysis of complex IBM i applications.
-
Documentation Generation: They automatically create comprehensive documentation by analyzing code structure, data flows, and business logic, capturing institutional knowledge that might otherwise be lost.
These tools typically integrate with modern development environments like VS Code, providing features such as inline code explanations, real-time suggestions, automated testing assistance, and interactive debugging support-all through natural language interfaces.
Why It Matters
The IBM i platform faces unique challenges that make AI-assisted development tools particularly valuable:
-
Addressing the Skills Crisis: As experienced RPG and COBOL developers retire, organizations struggle to find replacements. AI tools act as knowledge repositories, helping new developers understand legacy code patterns and business logic without years of platform-specific training. A developer familiar with modern languages can use AI assistance to become productive on IBM i in weeks rather than months.
-
Accelerating Modernization: Manual code modernization is time-consuming and error-prone. Converting a single 5,000-line RPG III program to free-form RPG IV might take days of careful work. AI-assisted tools can perform initial conversions in minutes, allowing developers to focus on validation and optimization rather than mechanical transformation.
-
Reducing Technical Debt: Legacy IBM i applications often contain undocumented business rules embedded in code. AI tools can extract and document these rules, making future maintenance safer and more efficient. They can also identify code smells, security vulnerabilities, and performance bottlenecks that might be missed in manual reviews.
-
Enabling Incremental Modernization: Rather than risky "big bang" rewrites, AI tools support gradual modernization. They can help refactor individual programs, convert DDS to SQL DDL incrementally, or modernize specific modules while maintaining compatibility with existing systems.
-
Improving Code Quality: AI-assisted tools enforce best practices consistently. They can suggest modern error handling patterns, recommend appropriate use of IBM i services, and ensure new code follows organizational standards-reducing the variability that comes from different developer skill levels.
-
Facilitating Knowledge Transfer: When senior developers leave, their expertise often goes with them. AI tools can capture coding patterns, business logic, and architectural decisions from existing code, preserving institutional knowledge in accessible formats.
How It Works
AI-assisted development tools for IBM i operate through several integrated mechanisms:
1. Foundation Models with IBM i Specialization
These tools are built on large language models trained on vast code repositories, including IBM i-specific languages. The models understand:
- RPG syntax across versions (RPG II, RPG III, RPG/400, ILE RPG, free-form RPG)
- COBOL dialects used on IBM i
- CL command syntax and program structure
- DDS specifications and SQL DDL
- Db2 for i SQL extensions and optimization techniques
2. Contextual Analysis Engine
When you provide code or ask questions, the tool:
- Parses the syntax and identifies language constructs
- Analyzes data flows and program dependencies
- Accesses relevant IBM i documentation and best practices
- Considers the broader application context
- Generates responses tailored to your specific situation
3. Natural Language Interface
Instead of memorizing complex commands, developers interact conversationally:
- "Explain what this RPG program does and identify potential issues"
- "Convert this fixed-format RPG to free-form while maintaining the same logic"
- "Generate a stored procedure to replace this native I/O operation"
- "Create unit tests for this CL program"
4. Code Generation and Transformation
The tools can:
- Generate new code from requirements or specifications
- Transform code between formats (fixed to free-form, native I/O to SQL)
- Refactor code to improve maintainability
- Create supporting artifacts (test cases, documentation, deployment scripts)
Important: Developers remain fully responsible for all code in their applications. AI-generated code is a suggestion that must be reviewed, tested, and approved by the developer before use. The developer owns the final code, not the AI.
5. Integration with Development Workflow
AI-assisted tools integrate seamlessly into existing processes:
- IDE Integration: Direct integration with VS Code, RDi, or other editors
- Version Control: Work with Git workflows for code review and collaboration
- CI/CD Pipelines: Automated code analysis and quality checks
- Documentation Systems: Generate and update technical documentation
- Testing Frameworks: Create and maintain test suites
6. Continuous Learning and Adaptation
Advanced AI tools can:
- Learn from your organization's coding standards
- Adapt to your specific business domain
- Improve suggestions based on feedback
- Stay current with IBM i platform updates and best practices
Key Takeaways
- AI-assisted development tools represent a fundamental shift from rule-based IDEs to intelligent assistants that understand context, intent, and semantics, making them particularly valuable for IBM i modernization where legacy code understanding is critical
- These tools address IBM i's unique challenges-including the skills gap, knowledge transfer, and technical debt-by acting as intelligent intermediaries that help developers understand, maintain, and transform legacy applications more efficiently
- They operate through specialized foundation models, contextual analysis, and natural language interfaces that integrate seamlessly with existing development workflows, enabling both experienced and new developers to work more productively
- The business impact is significant: organizations can accelerate modernization timelines, reduce risk through incremental changes, preserve institutional knowledge, and maintain IBM i applications with smaller, less specialized teams
- IBM Bob exemplifies this technology by providing specialized AI assistance for IBM i developers, combining deep platform knowledge with modern AI capabilities to support the full development lifecycle from code understanding to deployment
Different AI Assistants and IBM BOB with RPG
This chapter explores the landscape of AI tools that assist IBM i developers, focusing on AI-driven code assistants versus IBM BOB. It highlights how these tools support RPG, CL, and other IBM i languages, their operational differences, and practical use cases for improving productivity, code quality, and modernization initiatives.
What It Is
AI assistants for software development leverage machine learning and natural language processing to analyze, suggest, and generate code. Popular examples include GitHub Copilot, Claude AI, ChatGPT, Gemini, Gronk, and domain-specific solutions like IBM BOB. These tools help developers:
- Generate boilerplate code
- Suggest fixes or refactors
- Identify potential performance or security issues
- Enhance documentation and comments
- Support learning for new developers
IBM BOB, in particular, is an AI-driven analysis and assistance platform tailored for IBM i environments. Unlike general-purpose assistants, BOB provides deep insight into RPG, CL, and DB2 SQL programs, offering impact analysis, modernization guidance, and code quality assessment specific to IBM i applications.
Why It Matters
IBM i applications often form the backbone of enterprise operations, running mission-critical workloads. Maintaining and evolving these systems is challenging due to legacy languages, complex interdependencies, and long development cycles. AI assistants offer:
- Time savings – Automate repetitive tasks like syntax corrections and documentation.
- Code quality improvement – Detect patterns, bugs, and optimization opportunities that manual review might miss.
- Knowledge capture – Assist junior developers by contextualizing legacy code and IBM i best practices.
- Modernization support – Identify candidates for refactoring or migration to modern environments.
Choosing the right AI tool depends on development goals. While general-purpose assistants provide rapid code suggestions, IBM BOB is optimized for IBM i, combining AI reasoning with deep knowledge of RPG and IBM i architectures.
How It Works
General AI Assistants
- GitHub Copilot: Integrates into IDEs like VS Code to provide real-time code suggestions.
- Claude AI: Generates explanations, scripts, or SQL queries, excelling in contextual reasoning but requiring validation for RPG-specific constructs.
- ChatGPT: Offers flexible code generation, debugging suggestions, and explanations, needing specific prompts for IBM i nuances.
- Gemini: Combines multi-model reasoning and coding assistance, capable of handling structured queries and logic-heavy RPG routines.
- Gronk: Focused on predictive code optimization and pattern detection, helping identify inefficiencies in legacy RPG programs.
IBM BOB
- RPG and CL Expertise: BOB understands IBM i-specific syntax, legacy patterns, and runtime behavior.
- Impact Analysis: Evaluates potential changes to RPG programs, DB2 queries, and batch processes, reducing risk in production.
- Modernization Guidance: Recommends refactoring, identifies modernization candidates, and suggests migration paths to modular or web-enabled architectures.
- Integration with Existing Tools: Works alongside source control, compilers, and testing frameworks, allowing seamless workflow incorporation.
Key Differences Between General AI Assistants and IBM BOB
Practical Applications for RPG Developers
- Code Generation: Scaffold RPG programs, subroutines, or CL scripts.
- Code Review: Detect inefficient logic, unused variables, or redundant file operations.
- Refactoring: Recommend modularization of monolithic programs and modern design patterns.
- Knowledge Sharing: Enable less experienced developers to understand legacy RPG workflows.
- Testing and Debugging: Suggest test cases and error-handling improvements.
Why IBM i Shops Should Consider Transitioning
Traditional RPG development often relies on manual code reviews, tribal knowledge, and trial-and-error testing. While this approach has worked for decades, it limits productivity, slows modernization, and increases risk. Moving toward AI-assisted development offers:
- Faster onboarding – Junior developers can quickly understand and contribute to legacy systems.
- Improved code quality – Automated insights catch errors before deployment.
- Support for modernization initiatives – AI tools identify programs suitable for modernization, aiding cloud, web, or service-based transformations.
- Enhanced team efficiency – Reduces time spent on repetitive tasks, freeing developers for higher-value work.
AI-assisted development should be seen not as a replacement for IBM i expertise but as a force multiplier, helping teams maintain high-quality, scalable, and maintainable RPG applications while preparing for future modernization.
Key Takeaways
- AI assistants vary from general-purpose tools to specialized IBM i solutions like BOB.
- IBM BOB provides RPG-specific insights, impact analysis, and modernization guidance not available in general AI assistants.
- Combining AI tools like Copilot, Claude AI, ChatGPT, Gemini, and Gronk with developer expertise accelerates development, enhances code quality, and reduces risk.
- Transitioning to AI-assisted workflows positions IBM i teams to modernize systems efficiently while retaining operational reliability.
What is AI-Powered Testing?
This section explores how artificial intelligence is transforming software testing on IBM i. You'll learn what AI-powered testing means in practice, understand how it differs from traditional testing approaches, and discover how AI tools like IBM Bob can accelerate test creation, improve test coverage, and enhance quality assurance for IBM i applications.
What It Is
AI-powered testing refers to the application of artificial intelligence-particularly large language models and machine learning-to automate and enhance various aspects of software testing. Unlike traditional testing tools that rely on predefined scripts and manual test case creation, AI-powered testing tools can:
-
Intelligent Test Generation: Automatically create comprehensive test cases by analyzing code structure, business logic, and data flows. For IBM i applications, this means generating tests for RPG programs, SQL procedures, and CL scripts based on understanding the code's intent and potential failure points.
-
Test Data Creation: Generate realistic test data that covers edge cases, boundary conditions, and typical usage patterns. AI can analyze existing data structures in Db2 for i and create appropriate test datasets that exercise all code paths.
-
Automated Test Maintenance: Update test cases automatically when code changes, reducing the maintenance burden that often causes test suites to become outdated. AI can identify which tests need modification based on code changes and suggest or implement updates.
-
Defect Prediction: Analyze code patterns to identify areas most likely to contain defects, allowing teams to focus testing efforts where they'll have the greatest impact. This is particularly valuable for legacy IBM i code where certain patterns are known to be error-prone.
-
Natural Language Test Creation: Allow testers and developers to describe test scenarios in plain language, which the AI then converts into executable test code. For example: "Test the order processing program with an invalid customer number" becomes a complete test case with setup, execution, and validation.
These capabilities integrate with existing IBM i testing frameworks like RPGUnit and iRPGUnit, enhancing rather than replacing traditional testing approaches.
Why It Matters
AI-powered testing addresses critical challenges facing IBM i development teams:
-
Accelerating Test Creation: Manual test creation is time-consuming, often taking as long as writing the code itself. AI can generate initial test suites in minutes rather than hours or days, allowing developers to focus on refining tests rather than creating them from scratch. This acceleration is crucial for teams adopting DevOps practices where rapid, frequent deployments require comprehensive automated testing.
-
Improving Test Coverage: Traditional testing often misses edge cases and unusual code paths because humans naturally focus on expected scenarios. AI analyzes all possible execution paths and generates tests for scenarios developers might not consider, including error conditions, boundary values, and unusual data combinations. This comprehensive coverage reduces production defects and improves application reliability.
-
Reducing Maintenance Burden: Test maintenance is a major pain point-as applications evolve, test suites become outdated and eventually abandoned. AI-powered tools can automatically identify which tests are affected by code changes and suggest or implement updates, keeping test suites current and valuable. This is particularly important for IBM i applications where code may have been maintained for decades.
-
Bridging Skills Gaps: Writing effective tests requires deep understanding of both the application and testing best practices. AI tools act as testing experts, helping less experienced developers create high-quality tests by suggesting appropriate assertions, identifying missing test cases, and recommending testing patterns. This democratizes testing expertise across the team.
-
Enabling Legacy Code Testing: Many IBM i applications lack automated tests because they were written before testing frameworks existed. Manually creating tests for decades-old code is daunting. AI can analyze legacy RPG, COBOL, and CL programs to generate initial test suites, making it feasible to add test coverage to legacy applications during modernization efforts.
How It Works
AI-powered testing for IBM i operates through several integrated capabilities:
1. Code Analysis and Understanding
AI models analyze source code to understand:
- Program structure and control flow
- Data dependencies and transformations
- Business logic and validation rules
- Integration points with other programs and databases
- Potential failure scenarios and edge cases
2. Test Case Generation
Based on code analysis, AI generates:
- Unit tests for individual procedures and programs using RPGUnit or iRPGUnit
- Integration tests that verify interactions between programs and database operations
- Regression tests that ensure existing functionality remains intact after changes
- Edge case tests covering boundary conditions, null values, and error scenarios
3. Test Data Synthesis
AI creates appropriate test data by:
- Analyzing database schemas and constraints
- Generating realistic data that exercises all code paths
- Creating boundary and edge case values
- Ensuring referential integrity across related tables
4. Natural Language Interface
Developers and testers interact conversationally:
- "Generate unit tests for this RPG program"
- "Create test data for the customer order scenario"
- "Add tests for error handling in this procedure"
- "Update tests affected by this code change"
Important: Developers remain fully responsible for reviewing and validating all AI-generated tests. AI-generated tests are suggestions that must be examined, potentially modified, and approved before use in production test suites.
5. Continuous Learning and Adaptation
Advanced AI testing tools:
- Learn from existing test patterns in your codebase
- Adapt to your organization's testing standards
- Improve test quality based on feedback
- Identify patterns in defects to generate better tests
Key Takeaways
- AI-powered testing uses machine learning to automate test creation, maintenance, and optimization, dramatically reducing the time and expertise required to build comprehensive test suites for IBM i applications
- It addresses critical testing challenges including slow test creation, poor coverage, high maintenance costs, and skills gaps by acting as an intelligent testing assistant that understands code and generates appropriate tests
- AI testing tools integrate with existing frameworks like RPGUnit and iRPGUnit, enhancing rather than replacing traditional testing approaches while supporting natural language interactions for ease of use
- The technology is particularly valuable for legacy IBM i code where automated tests often don't exist, enabling teams to add test coverage during modernization efforts without massive manual effort
- IBM Bob provides AI-powered testing capabilities specifically designed for IBM i, understanding RPG, COBOL, CL, and SQL to generate contextually appropriate tests that follow platform best practices
How to Implement AI Testing Tools for IBM i Applications
You'll learn how to implement AI-powered testing tools for IBM i applications, covering setup, test generation, and framework integration. For integration testing and end-to-end testing, refer to the Test Driven Development with Automation chapter.
Before You Start
- Access to AI-powered testing tools (e.g., IBM Bob with testing capabilities)
- Existing testing framework installed (RPGUnit or iRPGUnit) or willingness to set one up
- Sample programs or modules to create initial tests for
- Understanding of your application's critical business logic and test requirements
- Team agreement on code review processes for AI-generated tests
Steps
1. Set Up Your Testing Framework and AI Tool Integration
Establish the foundation for AI-powered testing:
- Install Testing Framework: Set up RPGUnit or iRPGUnit. Create a dedicated test library for storing test programs
- Configure AI Tool: Install your AI testing tool (IBM Bob or VS Code with AI extensions). Set up authentication and workspace access
- Organize Tests: Create a directory structure mirroring source code with
/tests suffix - Define Standards: Document test naming conventions (e.g.,
TEST_programname ) and assertion patterns - Set Up Test Environment: Create test database schemas separate from production
What to expect: Setup takes 2-4 hours. Once configured, AI generates framework-specific test code. Your isolated test environment prevents production data corruption.
2. Generate Initial Unit Test Cases Using AI
Use AI to create your first automated unit tests:
- Start Simple: Select a straightforward program. Ask: "Generate unit tests for this RPG program using RPGUnit"
- Review Structure: Examine generated setup, test cases, assertions, and teardown logic
- Customize Scenarios: Request specific tests: "Add tests for boundary conditions" or "Generate error handling tests"
- Generate Test Data: Ask: "Generate test data for the customer table that exercises all validation rules"
- Compile and Run: Verify functionality and address any errors
What to expect: AI generates comprehensive test suites in minutes versus hours manually. Expect 20-30% of assertions to need adjustment. Start with 2-3 simple programs before tackling complex modules. Important: AI-generated tests must always be double-checked as AI is non-deterministic and can be biased. Auto-generated tests always carry operational risk and require human validation.
3. Integrate AI Testing into Your Development Workflow
Embed AI-powered testing into daily development. For comprehensive testing strategies including integration and end-to-end testing, refer to the Test Driven Development with Automation chapter.
- Test-Driven Development: Generate unit tests first: "Create tests for a procedure that validates customer credit limits"
- Legacy Code Coverage: Generate test suites for existing programs without tests
- Regression Tests: Create tests that reproduce bugs when fixing issues
What to expect: Teams see 40-60% unit test coverage improvement within 2-3 months. AI catches edge cases developers might miss. Remember that AI-generated tests require thorough review as AI can produce biased or incorrect assertions.
Verify It Worked
Confirm successful AI testing tool implementation:
- Unit Test Coverage: Achieved 70-80% unit test coverage for critical business logic, up from previous baseline
- Team Adoption: At least 70% of developers regularly use AI tools for test generation
- Test Quality: AI-generated tests pass code review after thorough validation and necessary corrections
Key Takeaways
- This chapter focuses on AI-powered unit testing only-for integration testing and end-to-end testing strategies, refer to the Test Driven Development with Automation chapter
- Proper framework setup is essential-install RPGUnit/iRPGUnit correctly before AI can generate framework-specific unit tests, ensuring consistency across the team
- AI generates tests quickly but requires thorough validation-AI is non-deterministic and can be biased, so developers must carefully review all generated tests for correctness. Auto-generated tests always carry operational risk
What Are AI Code Review Tools?
This section explains AI code review tools and their role in modern IBM i development. It defines what AI code review tools are, why they matter to RPG and IBM i teams, how they work in practice, and how they improve code quality, security, and maintainability. The goal is to help development teams understand how AI-assisted code review complements traditional peer review and static analysis while accelerating delivery and reducing technical debt.
What It Is
AI code review tools use artificial intelligence to analyze source code and provide feedback on quality, performance, structure, and potential issues. These tools go beyond traditional static analysis by understanding patterns, context, and intent in the code. Instead of simply checking rules or syntax, AI-based tools evaluate logic, detect inefficiencies, suggest improvements, and highlight risks.
In IBM i environments, AI code review tools examine RPG, CL, SQL, and related technologies to identify issues such as:
- Poor coding patterns
- Performance bottlenecks
- Security vulnerabilities
- Unused variables or logic
- Inconsistent naming or structure
- Technical debt
- Risky changes
Traditional code reviews rely on developers manually reading code and identifying problems. AI code review tools assist by scanning large amounts of code quickly and presenting actionable insights. They do not replace developers; they enhance developer productivity and consistency. For IBM i teams, AI code review tools act as an intelligent reviewer that continuously evaluates code and provides guidance during development, modernization, and maintenance activities.
Why It Matters
Code review is one of the most important practices in software development. It ensures quality, reduces defects, and improves maintainability. However, manual code reviews require time, experience, and consistency. As systems grow and teams become busier, reviews can become rushed or inconsistent. AI code review tools address these challenges by providing continuous and automated analysis.
Improved Code Quality
AI tools detect issues early in the development process. They identify inefficient logic, outdated patterns, and structural problems before the code reaches production. This reduces defects and improves overall system stability.
Faster Development Cycles
Manual code reviews can slow down delivery. AI tools provide instant feedback, allowing developers to fix issues during development rather than waiting for peer review. This shortens development cycles and increases productivity.
Consistent Standards
Different developers have different coding styles and review approaches. AI code review tools apply consistent standards across the entire codebase, ensuring uniform quality and structure.
Reduced Technical Debt
Legacy IBM i systems often contain decades of accumulated code. AI tools help identify outdated logic and modernization opportunities, allowing teams to gradually improve the system over time.
Enhanced Security and Compliance
AI code review tools detect security risks and compliance issues that might be missed during manual review. This is especially important in healthcare, finance, and enterprise environments where regulatory requirements are strict.
Knowledge Transfer
AI tools act as a knowledge assistant for less experienced developers. They provide suggestions and explanations that help developers learn best practices while working on real code. In IBM i environments, where experienced RPG developers are limited and systems are critical to business operations, AI code review tools provide a scalable and reliable way to maintain high-quality code.
How It Works
AI code review tools follow a structured process to analyze and evaluate code.
1. Code Ingestion
The tool reads source code from repositories, development environments, or files. This includes RPG programs, CL scripts, SQL procedures, and related artifacts. The AI system understands:
- Program structure
- Variables and data definitions
- Logic and control flow
- File usage and database access
- Business rules and patterns This creates a contextual understanding of the application.
2. Pattern and Logic Analysis
The AI analyzes the code for patterns and logical structure. It compares the code against known best practices, modern design patterns, and historical examples. The system looks for:
- Inefficient loops
- Repeated logic
- Poor error handling
- Performance issues
- Hard-coded values
- Security risks
- Unclear or complex logic
This analysis allows the AI to identify potential improvements.
3. Issue Identification
The tool generates findings and recommendations. Examples include:
- Suggesting better variable naming
- Recommending modularization
- Identifying unused fields
- Flagging performance concerns
- Highlighting risky database updates
- Detecting outdated RPG coding styles
Each issue typically includes:
- Description of the problem
- Risk level
- Suggested fix
- Explanation of impact
This makes it easier for developers to take action.
4. Recommendations and Improvements
AI tools provide suggestions for improving the code. Examples:
- Refactor large programs into smaller modules
- Replace outdated operations with modern RPG syntax
- Improve SQL performance
- Add validation or error handling
- Simplify complex logic
Developers review the recommendations and decide what changes to apply. The AI assists, but the developer remains in control.
5. Continuous Feedback
AI code review tools can be integrated into:
- Development environments
- Version control systems
- Build pipelines
- Testing processes
This allows code to be reviewed continuously rather than only during formal peer review. Developers receive feedback in real time, improving code quality before it reaches testing or production.
Key Takeaways
AI code review tools bring intelligence and automation to the code review process in IBM i environments.
Key points to remember:
- AI code review tools analyze code using artificial intelligence rather than simple rules
- They improve quality, performance, and security
- They provide consistent and continuous feedback
- They reduce technical debt and accelerate development
- They support RPG and IBM i modernization efforts
- They enhance, not replace, developer expertise
- They help teams maintain high-quality enterprise systems
AI code review tools represent a significant shift in how IBM i development teams approach quality and governance. Instead of relying solely on manual reviews, teams can leverage AI to provide continuous insight and guidance.
As AI capabilities continue to evolve, code review will become faster, smarter, and more integrated into the development lifecycle. For IBM i teams, adopting AI code review tools is a practical step toward modern, efficient, and high-quality software delivery.
How to Integrate AI into IBM i Development Workflows
You'll learn how to integrate AI-powered tools like IBM Bob into IBM i development workflows. This guide covers practical integration strategies, focusing on daily development tasks, with emphasis on manual reviews and documented testing procedures. Modern AI tools leverage agentic AI capabilities and standard protocols like MCP (Model Context Protocol) for enhanced integration.
Before You Start
- Access to AI-powered development tools (e.g., IBM Bob with MCP support, VS Code with AI extensions)
- Git version control and DevOps practices established on IBM i
- Understanding of your current development workflow and pain points
- Clear policies on code review and approval processes for AI-generated code
- Documented testing and validation procedures (refer to the Test chapter)
Steps
1. Establish Git and DevOps Foundation
Modern AI-based IDE integration requires version control and DevOps practices:
- Git Integration: Ensure source code is in Git repositories for AI context and collaboration
- DevOps Pipeline: Establish CI/CD pipelines on IBM i for automated testing and deployment
- MCP Protocol Support: Leverage tools supporting Model Context Protocol for standardized AI integration
- Agentic AI Capabilities: Modern AI tools use agentic approaches to autonomously navigate codebases and suggest improvements
What to expect: Git and DevOps practices enable AI tools to understand project history, dependencies, and team workflows, providing more contextual and relevant assistance.
2. Configure AI Tools and Establish Governance
Set up AI integration with clear policies:
- IDE Integration: Install IBM Bob or AI extensions in VS Code with MCP support
- Manual Review Requirements: Mandate that all AI-generated code undergoes rigorous manual review
- Testing Standards: Require documented testing and validation procedures (refer to the Test chapter)
- Security Protocols: Define what code can be shared with AI tools
- Developer Ownership: Clarify that developers own all production code, regardless of AI assistance
What to expect: Initial setup takes 30-60 minutes per developer. Clear governance ensures AI enhances rather than compromises code quality.
3. Integrate AI into Daily Development Tasks
Incorporate AI assistance into routine development activities:
- Morning Code Reviews: Use AI to explain overnight changes or analyze pull requests before team reviews
- Feature Development: Start new features by describing requirements to AI, then refine the generated code
- Bug Investigation: Ask AI to analyze error logs, explain problematic code sections, or suggest fixes
- Refactoring Sessions: Use AI to identify code smells and suggest modernization approaches
- Documentation Updates: Generate or update documentation as code changes, keeping it synchronized
- Knowledge Sharing: Use AI to create onboarding materials or explain complex business logic to new team members
What to expect: Developers will initially use AI for simple tasks (code explanation, documentation) before progressing to more complex uses (code generation, refactoring). All AI-generated code must undergo manual review and documented testing procedures. Productivity gains become noticeable within 2-4 weeks as the team develops effective prompting skills and validation practices.
Verify It Worked
Confirm successful AI integration into your workflows:
- Developer Adoption: At least 70% of team members regularly use AI tools for appropriate tasks
- Code Quality: AI-assisted code meets quality standards after manual review and documented testing
- Workflow Efficiency: Reduced bottlenecks in daily development tasks with AI assistance
Key Takeaways
- Git and DevOps on IBM i are essential for effective AI-based IDE integration in the development cycle
- Modern AI tools leverage agentic AI and MCP (Model Context Protocol) for standardized, enhanced integration capabilities
- Daily development tasks are the central focus-integrate AI into morning code reviews, feature development, bug investigation, refactoring, and documentation
- Manual reviews and documented testing are mandatory-all AI-generated code requires rigorous human validation (refer to the Test chapter for procedures)
- Developer ownership is non-negotiable-developers own all production code regardless of AI assistance
How to Decide When to Use AI Tools for IBM i Development
You'll learn when to use AI tools for IBM i development tasks, covering decision criteria for maximizing AI value.
Before You Start
- Understanding of your current development task or challenge
- Access to AI-powered development tools (e.g., IBM Bob, VS Code with AI extensions)
- Familiarity with your organization's AI usage policies and code review requirements
- Clear understanding of task complexity, time constraints, and quality requirements
- Knowledge of available traditional tools and approaches for comparison
Steps
1. Assess Task Characteristics and Complexity
AI tools excel at specific types of work. Use AI when explaining unfamiliar legacy code (RPG, COBOL, CL), performing repetitive tasks like converting fixed-form to free-form RPG, or tackling knowledge-intensive activities where you lack deep platform expertise. AI also accelerates exploratory work, brainstorming modernization approaches, and time-sensitive deliverables like documentation or prototyping.
What to expect: Tasks with multiple favorable characteristics are prime candidates. Avoid AI for simple changes or well-understood business logic where manual work is faster.
2. Evaluate Risk and Quality Requirements
Risk tolerance determines AI appropriateness. Use AI cautiously for production-critical logic, preferring it for supporting code rather than core algorithms. Avoid AI for security-sensitive operations like authentication or encryption unless you can validate thoroughly. For performance-critical paths, use AI for initial suggestions but validate with profiling. Exercise caution with compliance-regulated code subject to audit requirements.
What to expect: Categorize tasks as low-risk (documentation, learning), medium-risk (features, refactoring), or high-risk (security, compliance) to determine validation requirements.
Important: Developers remain fully responsible for all code in their applications. AI-generated code is a suggestion that must be reviewed, tested, and approved by the developer before use. The developer owns the final code, not the AI.
3. Compare AI Efficiency Against Traditional Approaches
Use AI when it saves at least 30% of total time including prompting and review. AI often generates more comprehensive documentation and consistent code patterns than manual approaches. It accelerates learning new technologies by providing explanations and examples. However, skip AI if you have proven templates to adapt or if validating AI output is more complex than creating code manually.
What to expect: AI excels when tasks are time-consuming but validation is straightforward.
4. Consider Team and Organizational Context
Team capabilities and organizational policies influence AI adoption. Use AI extensively if your team crafts effective prompts and validates output well, but ensure adequate review capacity since AI code needs rigorous examination. AI helps preserve knowledge and accelerate onboarding, though avoid it when building deep expertise is the goal. Respect code sharing policies, using on-premises tools for restricted code, and consider stakeholder expectations regarding AI disclosure.
What to expect: Teams with strong governance use AI broadly. Developing teams start with low-risk cases and expand gradually.
5. Make the Decision and Plan Validation
Use AI when task characteristics align (repetitive, knowledge-intensive), risk is acceptable, efficiency gains exceed 30%, and your team supports it. Avoid AI when tasks are simple manually, risk is unacceptable, validation is complex, or policies prohibit use. Consider hybrid approaches where AI generates initial code and you manually refine critical sections. Always define your validation approach-code review, tests, or benchmarks-and have a fallback strategy if AI output proves unusable.
What to expect: Document your approach for significant tasks and track outcomes to refine criteria over time.
Verify It Worked
Confirm your decision-making process is effective by measuring time efficiency (30-70% savings for appropriate use cases), quality metrics (AI code meeting standards with comparable defect rates), and team confidence in validating AI output. Team members should gain knowledge from AI interactions rather than accepting output blindly. Similar tasks should receive consistent decisions across team members, with minimal instances of AI-generated code requiring complete rewrites.
Key Takeaways
Use AI whenever possible for code understanding, repetitive work, and knowledge-intensive activities, but apply strict validation for production-critical, security-sensitive, or compliance-regulated code. AI should save at least 30% of total time (including review) to justify use. Team proficiency, review capacity, and organizational policies shape when AI is appropriate. Hybrid approaches-using AI for initial generation then manually refining critical sections-often deliver the best results by combining efficiency with expertise.
How to Choose AI Tools for IBM i Development
What This Covers
You'll learn how to evaluate and select AI-powered tools for IBM i development, covering tool categories, compatibility assessment, and integration considerations.
Before You Start
- Understanding of your development environment (VS Code, RDi, command-line tools)
- Clear identification of development pain points you want AI to address
- Knowledge of your organization's security policies regarding external AI services
- Budget considerations for commercial AI tools versus open-source alternatives
- Team skill levels and willingness to adopt new AI-assisted workflows
Steps
1. Identify IBM i-Specific AI Tool Categories
Understand the types of AI tools available:
- IBM i-Specialized Assistants: Tools like IBM Bob trained on RPG, COBOL, CL, DDS with platform-specific knowledge
- General-Purpose Coding Assistants: GitHub Copilot, CodeWhisperer, or Tabnine with broad language support
- IDE-Integrated Extensions: IBM Bob or VS Code extensions integrating AI into your environment
- Documentation Tools: Generate or maintain documentation from code analysis
- Testing Assistants: Generate test cases and data for RPGUnit/iRPGUnit
What to expect: Identify 2-3 categories matching your needs. Specialized tools provide better accuracy for IBM i tasks; general-purpose tools offer broader support. Most organizations use both.
2. Assess Language and Platform Understanding
Evaluate IBM i-specific technology understanding-a key criterion for tool selection:
- Language Coverage: Verify support for fixed-form RPG, free-form RPG, COBOL, CL, DDS, SQL. Test with your code samples
- Platform Knowledge: Assess understanding of library lists, data queues, IFS, PASE concepts
- API Familiarity: Check knowledge of IBM i APIs, QSYS2, JTOpen/JT400
- Version Awareness: Ensure understanding of RPG III through free-form RPG
- Database Integration: Verify Db2 for i specifics and native file I/O knowledge
What to expect: Specialized tools like IBM Bob show deep platform knowledge and excel with advanced IBM i-specific capabilities. General-purpose tools may struggle with legacy syntax but work for modern code. Test with your actual codebase.
3. Evaluate Workflow Integration
Determine workflow fit-tools should augment your development process, not change it:
- IDE Compatibility: Check IBM Bob or VS Code integration. Evaluate installation ease
- Version Control: Assess Git workflow compatibility, pull requests, CI/CD integration
- Authentication: Understand API keys, OAuth, or SSO requirements
- Offline Capabilities: Determine internet connectivity requirements
- Performance Impact: Test IDE responsiveness with large codebases
What to expect: Setup takes 15 minutes to several hours. IBM Bob or VS Code tools offer smoothest IBM i integration. Best tools enhance workflow naturally without requiring process changes.
4. Consider Deployment Model and Governance
Assess security implications and deployment options-a critical criterion for tool selection:
- Deployment Model: Evaluate on-premises versus SaaS options. Consider cloud regions where AI services are available
- Data Transmission: Understand what code goes to external services versus local processing
- Terms & Conditions: Review data logging policies, encryption standards, intellectual property rights, and whether customer data is used for model training
- Code Protection: Verify policies on code retention and intellectual property ownership
- Compliance: Check SOC 2, GDPR, HIPAA requirements. Consider on-premises options for sensitive code
- Access Controls: Evaluate authentication, role-based access, audit logging
- Vendor Security: Review certifications and security track record
What to expect: Cloud/SaaS tools offer convenience but require careful review of terms and conditions. On-premises deployment provides maximum control over data and intellectual property. IBM Bob provides enterprise deployment options for both models. Involve security teams for production code evaluation.
5. Distinguish Assistant vs Agentic Automation Capabilities
Assess the level of AI automation and support:
- Assistant Capabilities: Basic code completion, explanation, and suggestion features
- Agentic Automation: Advanced autonomous capabilities for navigating codebases, suggesting improvements, and performing complex tasks
- IBM Bob's Advanced Tools: Specialized agentic capabilities for IBM i including deep code analysis, modernization recommendations, and platform-specific optimizations
- Pricing: Compare subscription costs, usage-based pricing. Calculate total for your team
- Support: Assess documentation, forums, direct support, training resources
- Vendor Stability: Research financial stability and IBM i commitment
What to expect: IBM Bob shines with advanced agentic tools specifically designed for IBM i. Costs range from free to $10-50 per user monthly. Factor in 1-2 weeks training time.
Verify It Worked
Start with a pilot program to validate tool selection:
- Pilot Program: Begin with a subset of an application and a small team. Pilot, benchmark, and conduct proof-of-concept with business experts, architects, and developers. IBM and partners can help with this evaluation
- Productivity Gains: Team reports measurable time savings (30-50%) on tasks where AI tools are applied during the pilot
- Code Quality: AI-assisted code meets quality standards in reviews with defect rates comparable to manually written code
- Team Adoption: At least 70% of pilot team members actively use the selected tools for appropriate tasks
- Integration Success: Tools integrate smoothly with existing workflows without causing disruptions or performance issues
- Security Compliance: Tools meet your organization's security and compliance requirements with no policy violations
- ROI Achievement: Pilot demonstrates that tool costs are justified by productivity gains, reduced training time, or improved code quality before organization-wide rollout
Key Takeaways
- Key selection criteria include language and platform understanding, workflow integration (augmenting development without changing it), deployment model and governance, and assistant versus agentic automation capabilities-IBM Bob shines with advanced tools specifically designed for IBM i
- Deployment model is critical-evaluate on-premises versus SaaS/Cloud options, considering cloud regions, data logging policies, encryption, intellectual property rights, and whether customer data is used for model training
- Test with actual code samples to assess real-world effectiveness with legacy syntax and platform-specific APIs before committing
- Workflow integration should augment, not change-prioritize tools that enhance existing processes without requiring workflow disruption
- Start with pilot programs-evaluate with business experts, architects, and developers on a subset of an application, measuring productivity, quality, and satisfaction before organization-wide rollout. IBM and partners can assist with pilots
What are the Security Best Practices when Using AI?
Security considerations must be woven throughout the development and deployment of any type of AI project. From the simple AI-enabled chatbot to Agentic AI, it is imperative that a project goal be to ensure the integrity of your organization's data throughout the entire project.
Why It Matters
The saying 'garbage in, garbage out' could not be more true when describing the effect of data being fed into an AI project when the data shouldn't be a part of it or is inaccurate. When training a model, data cannot be 'unlearned' so confidential data or inaccurate data fed into a model will cause the model to not contain the scope of data that will lead to a successful project. When training a model or updating a model, bias can be introduced, inaccurate data introduced due to accidental or purposeful inaccurate changes by the trainers or bad actors. When developing Agentic AI projects, Agents with too much access can go rogue causing business disruption. Unsecured git repositories can allow bad actors to inject bad code to purposefully cause damage or to leak data. Good security practices throughout an AI project can help prevent all of these issues.
AI projects are exciting and everyone wants to jump right in. Unfortunately, this zeal to use and be a part of the newest technology will often cause the security aspects of the project to be completely ignored. We encourage you to ask the security questions PRIOR to the project taking off and be an advocate for implementing sound security practices from start to finish.
How It Works
Familiarize yourself with your organization's security policy and regulatory requirements for the data
If you aren't aware of the regulatory requirements for the data being used for your AI project, it's very easy to violate them. And unfortunately, ignorance of a law or regulation doesn't excuse a violation or the fines that follow. It's also easy to violate the use of Personally Identifiable Information (PII) and/or expose it inappropriately within your organization or even to the world if you don't know what constitutes PII or its appropriate use. Finally, your Organization has confidential data that makes it unique. Understand whether this data is allowed to be used and what you must do to protect it.
Only input your Organization's Data in the LLM being used internally by your Organization
Well known data leaks have occurred when developers, eager to explore AI, used company confidential data in a free LLM, making it available to anyone in the world using that LLM. Don't be that person! There's no taking back your data. Once presented to an LLM, it can't 'unlearn' it!
Secure your Organization's data being used in your AI project
Proper access control settings are key to the security of your AI project. If the access control settings of your data used for initial training or the data used to update your model can be updated, it can be subject to data poisoning or insertion of bias. An open gist containing your Agentic AI tool definitions can be subjected to code injection. Or an open MCP server configuration file may allow for account takeover. These are just a few of the vulnerabilities created when the default access is not restricted. Every piece of data fed into a model, source code and configuration files must be protected.
At every step, use every security tool at your disposal
Security features are often integrated into your toolset. While security is usually not a feature developers enjoy, we're simply asking you to use what's at your disposal and not turn it off or ignore it. For example, GitHub comes with security features. Here's the link in case you're not familiar with them. Likewise, your IDE may come with code scanning technology such as the technology that comes with the Bob plug-in. Like all code issues, the earlier you find them in the development process, the easier they are to address. The same applies to security vulnerabilities.
Don't use or encourage Shadow AI
The challenge for IT used to be Shadow IT where parts of the business develop or purchase their own applications outside of the regular purchasing process. The problem with this practice is that they don't have the regular business support in debugging problems, backing up data, upgrading the application, etc. The problem is now compounded with advent of Shadow AI, where groups within an Organization have started to use easily obtained LLMs to perform their own business processes. What's the harm with this? It is far more likely that these groups are going to leak confidential data via a commercially available LLM as well as leave unsecured source scattered around the Organization or in their own gists. Please do not encourage the use of Shadow AI and don't be one of those individuals that go around the practices and policies the organization has put in place defining how AI is to be used.
When developing Agents, consider when - or if - a Human needs to be involved
Agents are being developed to replace tasks Humans perform but does that mean that humans are totally removed from the process? It depends on the task the Agent is performing. HITL - Human-in-the-Loop is when a task is performed by an Agent and then is reviewed by a human. An example of this may be a highly regulated industry that requires review and approval at each step of a process (for example, the pharmaceutical industry.) Slightly less involvement is a form of HOTL - Human-on-the-Loop. The best example of this we've observed is supervised self-driving cars. Finally, the total lack of human involvement is called HOOTL - Human-out-of-the-Loop. We suggest that this approach only be used once the process is fully tested and you can prove that the Agents will stick to their tasks and not go rogue.
Bob's Security Recommendations
Bob comes with some security recommendations described here. Here are some highlights:
- Review and limit auto-approve settings. While the constant back and forth of the approval process may tempt you to auto-approve your workflow, you can open up your Organization to data loss. Auto-approving command line access is particularly risky. Know your risk before you enable auto-approve.
- Bob - and all other LLMs - can hallucinate. Output must be verified.
- LLMs cannot keep a secret! They are not like your best friend to whom you can tell your secrets and know they will never be passed along. Even a temporary inclusion can cause that information to escape and create a risk for your Organization.
- Bob recommends tracking all actions for accountability. And we definitely agree with that premise but you need to understand what is and what is not logged. Do not expect an immutable audit log. The log is more of a tracking mechanism for the actions that have been taken. Great for debugging issues but may not be the audit log that will meet your compliance requirements.
Key Takeaways
- Consider security at every step in the development process
- Secure your data and environment to help the reduce the risk of it being compromised
- Use every security tool available to you
What are Security Best Practices when Developing AI Agents?
Agents - whether running tasks on IBM i or any other platform - must run with a user account created on that platform. Given the future of Agents running tasks on their own and deciding on its own to run others, it's imperative that security guardrails be put in place as Agents are developed.
Why It Matters
Agentic AI has the potential to make significant improvement in workflows - taking away mundane tasks and automating a lot a work currently done manually. As a human, we have roles that we play within an organization and are authorized (allowed to do things) based those roles. AI Agent profiles - whether on IBM i or any other platform - that are created to represent a human or to perform human-like tasks, should be authorized similarly to their human counterparts. In fact, some (like us) may argue that even more - not fewer - restrictions should be placed on these profiles to ensure the Agents stay within the role for which they're intended and don't overstep their intended place in the organization - in other words ... don't go rogue.
How It Works
First, ensure the IBM i profile representing an AI Agent is created with least privilege access - the complete opposite of what you might be tempted to do. One might be tempted to create a superuser profile with all privileges (that is, all special authorities including *ALLOBJ) to ensure that the profile has sufficient authority to perform its task. The problem with this approach is that there's no guarantee with an AI Agent that it will stay within it's intended task. In fact, that's part of the point of an agent - that it will learn and start to take on more tasks. Creating the profile as a superuser allows it to not just learn new tasks and perform but to also walk throughout the system doing whatever it wants to ... including cancelling scheduled jobs, ending others' jobs, downloading data, modifying data and worse, deleting data, deleting backups, changing users' passwords and/or disabling or deleting user profiles, ending auditing, etc. As a superuser one can do anything. Hopefully you can understand why this is a bad idea when it comes to creating a profile for an AI Agent!
To create a profile with least privilege access, we recommend the following settings. This is an example of creating an Agent profile for running Inventory processes:
This is an example of a profile that may be only running processes or accessing the system via APIs and is authenticating via a Modern authentication technique such as OAuth. If the profile requires a password, make the password as long as the system it's connecting to allows. If the password is provided on a connection, ensure the connection is made using an encrypted session (using TLS 1.3) and the source storing the password is secured.
What Do You Do if the Operating System Function Requires *ALLOBJ?
We're recommending least privilege access but what happens if a special authority is required for the Agent to perform its tasks? For example, perhaps the Agent is tasked with identifying old objects no longer in use. If the Agent runs the QSYS2.OBJECT_STATISTICS or QSYS2.IFS_OBJECT_STATISTICS SQL services, the result will only list the objects for which the Agent has some authority (not *EXCLUDE.) You could think about wrappering this service in a CL program that adopts but adopted authority is ignored when accessing IFS objects. Enter Function Usage - a system feature that can mitigate the need for *ALLOBJ and other special authorities in some cases. In this specific case, the Agent could be granted access to the QIBM_LIST_ALL_OBJS and QIBM_LIST_ALL_OBJS_SQL function usage identifiers which will allow objects to be listed even if the profile has no authority or is explicitly excluded. See this IBM doc for the specific details of this function. See Appendix H of the IBM Security Reference manual for a list of all functions that may allow you to mitigate the need for *ALLOBJ and other special authorities such as *IOSYSCFG. For a full description of Function Usage see section IBMI-SEC-CONCEPT-197.
Create one Agent per Task
To ensure the ability to create profiles with only the authority they need for their task, create one profile per task. Or at least one profile per role. Overloading the same profile with multiple roles will cause some profiles to run with more authority than required, potentially allowing them to perform tasks outside of their role.
Using separate profiles also makes debugging failed jobs easier and makes audit journal entries more meaningful.
Should Agents be a Member of a Group Profile?
Since an Agent is taking on the tasks of a Human, you have to determine how to authorize the Agent's profile to the same tasks as the Human's profile. One obvious choice is to make the Agent's profile a member of the Human's group. Or is it? Doing so would certainly give the Agent the same access. But before doing that, you'll need to think through whether you want the Agent to have the full access and capabilities of the Human. Considerations include:
- All special authorities granted to a group filter down to the members
- Any objects owned by a group are also owned by the members
If neither of these two things are of concern, then you may want to make the Agent a member of the Human's group. However, if these items are giving away too much access or you're just not comfortable doing this (like us), we recommend creating a group profile for the Agent assigning only the special authorities required and granting authority only to the objects needed for the Agent's task. By creating a group profile for the Agent, you are following the premise of Role-based Access (RBAC) where each role is represented by a group. If another Agent is created with the same responsibilities (that is, is in the same role) you can simply assign the New Agent to this group and their authorities and capabilities are automatically assigned (via the group).
Agents Should Not Talk to All Other Agents
Also, the popular thought is that Agents should talk to all other Agents to find efficiencies. We encourage you to reconsider that, taking a 'deny by default approach' allowing Agents to talk to other Agents only when it makes sense. For example, should Agents running processes associated with Inventory have a need to talk to an Agent running HR processes? Likely not. Given the sensitivity of HR data and processes, only Agents with a specific requirement should be allowed to talk to the HR Agent. Access to Agents should follow the same access determinations as access to data - and allow access only for those whose role requires it.
Put as Many Guardrails in Place as Possible
Since we really don't know what an Agent might eventually try to do (that's the allure of Agentic AI after all), we encourage you to put as many guardrails in place as possible to confine an Agent to its intended role. In addition to creating the Agents' user profile (*USRPRF) with the attributes listed earlier, now's the time to implement multiple layers of defense - that is, if the Agent gets around one restriction, what's the next restriction that will catch and prevent the Agent from going rogue? Suggestions include, specifically granting Agent profiles private authority *EXCLUDE when data is *PUBLIC *USE to prevent access to data for which the Agent has no business reason to access it. Same goes for directories containing data. If the directory remains *PUBLIC DTAAUT(*RX), grant the Agent a private authority DTAAUT(*EXCLUDE) OBJAUT(*NONE) to prevent access. Ensure the Agent profile has no access to any functions in Function Usage (including the ability to use Navigator for i and the parts of Access Client Solutions (ACS) it shouldn't be using.) And if your organization has implemented exit point software from one of the security vendors, now's the time to use it. Put rules in place to specifically disallow Agents' access to operations such as FTP, ODBC, DDM, etc.
Note: If you choose to create a profile with *ALLOBJ special authority, very few guardrails are available to effectively control the Agent. Resist the urge to create a profile with *ALLOBJ special authority!
Add Additional Logging (auditing) to the Agent Profile
You can attempt to restrict access for an Agent but another security aspect to consider is to add additional auditing beyond what is enabled at the IBM i system level.
Assuming that auditing is configured at the system level (QAUDCTL is set to at least *AUDLVL and QAUDLVL contains at least *AUTFAIL, *CREATE, *DELETE, *PTFOPR, *SAVRST, *SECURITY (or *SECRUN and *SECCFG) and *SERVICE (it's ok if it contains more values) we recommend that the following be added at the user level. Note: No need to specify any of the previously listed values unless they aren't contained in the QAUDLVL system value. If that's the case, add them to the AUDLVL parameter on this command:
CHGUSRAUD AGT_INV AUDLVL(*CMD *JOBBAS *NETCMN *NETSECURE *NETUDP *OBJMGT)
The values *NETSMBSVR and *NETTELSVR will also help you track the actions of the Agent profile; however, they can only be specified at the system value level (QAUDLVL) and most organizations do not configure them because they generate large numbers of audit journal entries.
Security administrators can then use the audit journal helper functions to monitor the Agent profile's actions. For example, the following looks for authority failure (AF) audit journal entries. Regular examination of these specific entries could be an indication of a couple of things ... First, as an Agent learns and expands its own tasks, it may attempt to do things or access obtains for which it doesn't have authority. Review of these audit journal entries will let the security administrator will observe failures encountered by agents, and a review can be held to determine if access should be granted. On a more negative side, examination of these entries could be an indication that the Agent has gone rogue or has been taken over/infiltrated by a bad actor. While AF entries aren't often part of a regular review, we encourage it in this case.
This is just one example. We encourage you to work with your organization's security administrators to determine the other audit journal entries that they can monitor for that will be an indication of an Agent going outside of its intended role.
MCP Servers
Exact security considerations for MCP servers will depend on where they are implemented – on the client side or the server side. Pay attention to the implementation’s security recommendations, paying specific attention to authentication methods to ensure no credentials are compromised.
Here are some recommendations relating to Bob and MCP servers: Understanding MCP in Bob
Resources
IBM partnered with Anthropic to develop this white paper: Architecting Secure Enterprise AI Agents
IBM has also developed several YouTube videos on this topic. Search for the IBM Think Technology channel.
Key Takeaways
- Create the Agent profile with only the capabilities required for the intended task - no more
- Create one Agent per task
- Only allow Agents to talk to one another if it makes sense
- Add as many guardrails as possible to restrict what an Agent can do
Why Use MCP to Interface AI with IBM i
Model Context Protocol (MCP) is an open standard, created by Anthropic and implemented by most modern business operating systems, that delivers a standardized way for Artificial Intelligence (AI) assistants to securely connect with IBM i systems, query databases, execute commands, and interact with applications.
MCP is designed to allow many different types of AI to interface to any business server (including IBM i) using a single protocol that is scalable, securable, and auditable, while allowing for business rules (often called AI guardrails) to be implemented.
The following diagram shows three different classes of AI on the left, connecting via the same MCP interface in the middle, to different server-side resources on the right.

Below are some of the key benefits of MCP integration with IBM i:
-
Real-Time Access to System Information: MCP enables AI assistants to query IBM i databases, examine system configuration, review job logs, and access other system information in real-time. When troubleshooting an issue, the AI can examine relevant system logs and job details directly. This real-time access means assistance is based on current, accurate information rather than assumptions or outdated documentation.
-
Context-Aware Code Assistance: With MCP access to your source code repositories and database schemas, AI assistants can provide suggestions that fit your actual environment, referencing your existing programs, understanding your naming conventions, and suggesting changes that integrate with your specific codebase. This context awareness dramatically improves the relevance and usefulness of code assistance, reducing the time developers spend adapting generic suggestions to their specific situation.
-
Secure, Auditable Interactions: MCP implements security at its core — AI assistants do not get blanket access to your systems. Instead, you control exactly what resources are accessible and what operations are permitted. Every interaction can be logged and audited, providing transparency about what the AI accessed and what actions it performed. This security model makes it practical to provide AI assistance in production environments while maintaining the control and oversight that enterprise systems require.
-
Consolidating AI Investment Across IT Platforms: From a business investment point of view, because MCP is an open, standardized protocol, investments you make integrating AI with IBM i can be easily extended to AI integration with other business systems in your estate, regardless of the hardware, operating system, application, or database they run on.
-
MCP Enables Practical AI Assistance for Daily Workflows: The most immediate benefit of MCP integration is making AI assistance genuinely useful for daily work. Developers can ask questions about database schemas and get answers based on actual table definitions. They can request help with SQL queries and have the AI test those queries against real data to verify they work correctly. Operations staff can ask about system performance and have the AI examine actual metrics rather than providing generic optimization advice. This practical assistance reduces the time spent on routine tasks and helps teams work more efficiently.
You can then build upon this foundation to enable more sophisticated assistance. Imagine an AI assistant that monitors your IBM i system proactively, identifying potential issues before they become problems, or an assistant that can analyze application logs to identify patterns that indicate emerging issues. These capabilities are achievable today by combining MCP's access to system information with AI's pattern recognition abilities.
MCP Preserves IBM i Security While Enabling Innovation
One of the most important aspects of MCP is how it enables AI integration without compromising security. Traditional approaches to AI integration often require exposing systems through broad APIs or granting extensive permissions. MCP's architecture allows fine-grained control — you can provide an AI assistant access to read database schemas without allowing data modification, or permit execution of specific commands while restricting others.
You can deploy multiple MCP servers on the same host, each with different restrictions in their abilities, data access, and permitted users. This security model makes it practical to experiment with AI assistance in production environments. This approach respects the reality that IBM i systems often contain sensitive business data while still enabling the benefits of AI assistance.
For example, you could start with read-only access to non-sensitive information, verify the value, and gradually expand access as you gain confidence. The audit trail ensures you can review what the AI accessed and identify any concerns.
MCP Creates a Foundation for Future AI Capabilities
While MCP's immediate benefits are compelling, its long-term value lies in creating a foundation for capabilities we're only beginning to imagine. As AI models become more sophisticated, the ability to interact with IBM i systems through a standardized protocol becomes increasingly valuable. Consider potential future scenarios: AI assistants that can help migrate applications by understanding both source and target environments, intelligent monitoring systems that correlate system metrics with business outcomes, or development tools that suggest optimizations based on actual usage patterns.
In Summary
MCP represents a practical approach to bringing AI assistance into IBM i environments. It respects the security and reliability requirements of enterprise systems while enabling the context-aware assistance that makes AI genuinely useful. For most IBM i shops, the question is not whether to integrate AI assistance, but how to do so safely and effectively. MCP provides the answer: a standardized, secure, and practical approach to bridge the gap between AI capabilities and IBM i systems.
Should I care about testing AI?
Absolutely, testing AI is not optional. AI systems are fundamentally different from traditional software because their outputs are probabilistic and data-driven, rather than strictly deterministic. This introduces new risks that testing must address.
Premise
Why do we test? The obvious answer is to catch bugs before production, avoiding disruptions, losses, and damage to the company. Ultimately, we test because we are responsible for what we deliver, and this responsibility can extend to top management and even regulators.
Testing serves to reduce risk. Until recently, testing could have been relatively limited, relying on deep expertise to mentally validate solutions before writing code. But with LLM models, much of the work is changing: AI can generate solutions quickly, but without the certainty of fully understanding the business, and sometimes with errors. This leaves us with a new role: validating what we haven't fully designed ourselves. Testing, already repetitive, becomes even more central and is clearly an ideal candidate for automation.
So the real question is: how do we test to detect even the smallest change in behavior and quickly decide whether it's correct?
Ultimately, you must account for: Trust · Validation · Legal Regulation
1. AI Systems Can Be Unpredictable
Unlike classical (deterministic) programs:
- AI models (like machine learning or LLMs) produce outputs based on patterns in training data
- Small changes in input can lead to unexpected or incorrect outputs
- Biases in training data may produce unfair or unethical results
Without proper testing, AI can silently produce wrong, unsafe, or biased outcomes.
2. Key Areas to Test in AI Systems
3. How to Test AI
Testing AI differs from traditional testing:
- Unit Testing for AI Functions — Test preprocessing, feature extraction, and individual model components.
- Integration Testing — Ensure AI modules work correctly with the system (databases, APIs, UI).
- Behavioral / Scenario Testing — Use representative real-world scenarios to test AI outputs.
- Regression Testing — Ensure model updates or retraining don't degrade performance or introduce bias.
- Monitoring in Production — Continuously monitor AI outputs to detect drift, anomalies, or unexpected behavior.
The most important point is to always follow a deterministic approach in any testing.
4. How to Test AI Outcomes When Using AI for Code Generation
-
Unit Testing may be insufficient or unusable. If the code generation is a modernization effort, the code structure changes and existing unit tests may no longer apply. AI can generate new unit tests in the new structure, but this introduces operational risk through auto-referenced tests or possible bias. End-to-end and real-world testing will also be necessary.
-
Watch for new silent test cases in the generated code. New structures, methods, languages, or environments may require tests that didn't exist before. For example: a stateful RPG program using direct RLA access naturally locks a record at initial read. If transformed to stateless SQL access with pessimistic or optimistic locking, an extra timestamp column may be required — and formal concurrency tests become necessary where none existed before.
-
Organisation & Governance. Segregation of duties is essential: operate independent testing from AI to overcome operational risks. A test cannot be self-referencing — do not rely solely on AI-generated tests.
-
The 3 Laws of Testing (ARO): Autonomous, Reproducible, Observable. See the chapter Test Driven Development with Automation / Why test IBM i applications? for full details. Ensure all three laws are respected.
-
End-to-end & Real-world Testing vs. the "painted door problem". In AI, the "painted door problem" means something that looks correct but doesn't work in real life — like a painted door that doesn't open. What you ultimately want to test is not the code itself, but the behavior of the application from an end-to-end standpoint.
-
Full coverage of application scenarios. Ensure all critical application scenarios are covered. Code-coverage metrics — triggered manually or via a testing framework — provide a measurable indicator of whether testing is sufficient.
-
Governance. From a legal and regulatory standpoint, you are accountable for what AI produces. In some cases you must demonstrate proper governance and auditability.
-
Automate testing. When leveraging AI, test automation becomes essential to keep pace.
5. Why It Matters
- Regulatory compliance (e.g., GDPR, AI Act in the EU)
- Maintaining trust in AI-driven decisions
- Preventing financial loss, legal liability, or reputational damage
Even if the AI "works most of the time," failures can be catastrophic in critical systems like finance, healthcare, or IBM i enterprise workflows.
Takeaway
You must test AI, but the approach is different: focus not just on correctness, but on robustness, fairness, explainability, and continuous monitoring. If you use AI to automate code generation you will have to automate testing as well. And if you want to confidently trust AI, your tests will need to be deterministic.
Tip: Tools can be highly valuable here. See the chapter Test Driven Development with Automation / What testing tools work with IBM i?
Using Sample Prompts to Get Better Results from IBM Bob
IBM Bob's effectiveness scales directly with the quality of the instructions it receives. A vague prompt yields a generic result. A precise, context-rich prompt yields output that is targeted, standards-compliant, and immediately actionable. This section covers the core techniques IBM i developers can apply to construct prompts that consistently produce high-quality RPG, CL, and SQL output.
The Five Elements of an Effective Prompt
A well-structured prompt for IBM Bob contains five elements. Each narrows the solution space and directs output toward a precise result.
- Context establishes where the work fits—what platform, project, or existing codebase is involved. Without context, Bob generates solutions in a vacuum.
- Task states the explicit action required. Use direct imperatives: create, analyze, convert, review. Avoid ambiguous verbs such as "help with" or "look at."
- Requirements enumerate the specific behaviors the output must satisfy—RPG format, data structure patterns, SQL standards, and service programs to be called.
- Constraints define boundaries the output must not cross: performance targets, backward compatibility, library restrictions, or HIPAA data handling rules.
- Format specifies how output should be delivered—a compilable source member, a markdown document, or a structured analysis report.
Role-Based Prompting
Assigning a professional role at the start of a prompt is one of the most effective techniques for improving output quality. When Bob is given a role, it draws on the reasoning patterns, priorities, and communication style associated with that expertise. A senior IBM i software engineer focuses on correctness, ILE conventions, and platform-specific idioms. An IBM i architect emphasizes coupling, activation groups, and long-term structure. A code reviewer surfaces violations, risks, and improvement opportunities with evidence.
The role instruction belongs at the very beginning of the prompt, before context or task. This ensures Bob's reasoning posture is established before it interprets any other instruction.
Best Practice: Assign a role at the start of every non-trivial Bob interaction. Match the role to the task type: engineer for implementation, architect for design, reviewer for analysis, documentation specialist for technical writing.
Referencing Standards Documents
When a team maintains coding standards in a project rules file—such as
Iterative Refinement
Even well-structured prompts benefit from correction passes. When Bob's output contains specific issues, the most efficient response is a targeted correction instruction—not a full prompt rewrite. State the line number, the problem, and the required fix. Direct Bob to correct only those items.
Summary
IBM Bob's value to an IBM i development team scales directly with prompt quality. The five-element structure—context, task, requirements, constraints, and format—provides a repeatable foundation. Role-based prompting shifts Bob's output from generic to expert, with minimal additional effort. Standards references eliminate the need to restate conventions in every interaction. Iterative refinement corrects specific issues without discarding work already done. Applied together, these techniques produce output that reflects the judgment and precision expected of IBM i enterprise software development.
Note: The prompt patterns in this section are starting points, not rigid templates. Teams should adapt them based on their environment, standards documents, and the task types their developers encounter most frequently.
Key Takeaways
- Prompt quality determines AI quality — clear, structured, and contextual prompts produce more accurate and useful results in IBM i environments.
- Prompt sampling is an iterative process — testing multiple prompt variations and refining them over time leads to better and more consistent AI output.
- Strong prompts follow a structured pattern — effective prompts include a defined role, clear task, system context, expected output format, and supporting input such as RPG, CL, or SQL code.
- Context is critical in IBM i development — including IBM i version, DB2 for i details, program type, and environment constraints ensures AI responses are technically accurate and compatible.
- Reusable prompts increase team productivity — maintaining a shared prompt library standardizes AI usage and reduces time spent rewriting instructions.
- Prompt sampling supports multiple development activities — AI prompts can be used for code analysis, SQL optimization, documentation generation, troubleshooting, and modernization efforts.
- Prompt libraries should be treated as development assets — storing prompts in version control alongside source code enables repeatable and scalable AI workflows.
- AI becomes more valuable with structured usage — organizations that standardize prompt sampling achieve more reliable and efficient AI-assisted development on IBM i.
- Continuous refinement is essential — prompts should evolve alongside system upgrades, new development practices, and emerging AI capabilities.
- The goal is consistency and trust — well-designed prompts transform AI from a general assistant into a dependable IBM i development partner.