Eight questions decide whether an IBM i is ready for AI agents. Each one has a check you can run today: read-only SQL, what a good result looks like, and what makes a wrong answer look right.
Short answer. Before an AI agent connects to IBM i, check eight things: no unguarded exit points, open IFS shares or unruled network paths to Db2 (leakage prevention); a dedicated profile for the agent with only the authority it needs (workload identity); journaling with before and after images, so changes can be reversed (reversibility); a named person accountable for each agent (human accountability); business logic the agent can call instead of writing to tables (intelligence stack maturity); data readable through SQL (data legibility); change control that covers what the agent touches (autonomy discipline); and an audit journal that records who changed what (observability). Every check below is read-only SQL you can run today.
Run these under a profile with *ALLOBJ or *SECADM. Every query only reads; none of them changes the system.
Several of these services show only what the person running them is allowed to see, so a normal user can get no rows and look clean when they aren't. Column names can vary by IBM i release and Technology Refresh; if one fails, check IBM's page for that service on your release.
We ran every query on this page on our own IBM i test system, not a client's, in November 2026. Several of the cautions below are there because the first version of a query gave us an answer that looked right and wasn't.
Replace <APPLIB> with the library that holds the application's data, <JRNLIB>/<JRN> with the journal its files are journaled to, and <AGENT_PROFILE> with the profile the agent runs under.
These are the same eight areas the Agent-Ready Read scores. The Read takes about three minutes, needs no account, and tells you which of the eight is thinnest, so you know which check to run first.
Safety controls · what the platform enforces for you
On IBM i: Exit points · IFS exposure · network access to Db2
The check. List the exit points that have no exit program registered (WRKREGINF), starting with the database server, FTP and remote command ones. Then check what exit points miss: SSH, which has none, and Mapepire, whose connections all look local to an exit program, so its IP rules live in its own file. Then list your IFS shares and who can reach them.
-- Each exit point with how many exit programs it has (0 = nothing in front of that door)
SELECT p.exit_point_name, p.exit_point_format, COUNT(g.exit_program) AS exit_programs
FROM qsys2.exit_point_info p
LEFT JOIN qsys2.exit_program_info g
ON g.exit_point_name = p.exit_point_name
AND g.exit_point_format = p.exit_point_format
WHERE p.exit_point_name LIKE 'QIBM_QZDA%' -- database host server
OR p.exit_point_name LIKE 'QIBM_QTMF%' -- FTP
OR p.exit_point_name = 'QIBM_QZRC_RMT' -- remote command
OR p.exit_point_name LIKE 'QIBM_QTMX%' -- REXEC (port 512)
GROUP BY p.exit_point_name, p.exit_point_format
ORDER BY p.exit_point_name;-- What's listening, and which job and user own each port (a port nobody can name is the finding)
SELECT DISTINCT n.local_port, n.local_port_name, n.local_address, j.job_name, j.authorization_name
FROM qsys2.netstat_info n
LEFT JOIN qsys2.netstat_job_info j
ON j.local_port = n.local_port AND j.local_address = n.local_address
WHERE n.tcp_state = 'LISTEN'
ORDER BY n.local_port;-- Mapepire's IP rules: which user may connect from which address. -- No rows means no rules: Mapepire then accepts any profile from any address. SELECT line_number, line FROM TABLE(qsys2.ifs_read(path_name => '/QOpenSys/etc/mapepire/iprules.conf')) ORDER BY line_number;
-- IFS shares: first how many, so "none" reads as 0 SELECT COUNT(*) AS shares FROM qsys2.server_share_info;
-- ...then each one, if there are any SELECT server_share_name, path_name, permissions FROM qsys2.server_share_info;
-- NFS exports: the shares above don't include them -- An export added with CHGNFSEXP -I isn't written to the file: WRKNFSEXP shows those too. SELECT line_number, line FROM TABLE(qsys2.ifs_read(path_name => '/etc/exports')) ORDER BY line_number;
-- What INETD is set up to start SELECT line_number, line FROM TABLE(qsys2.ifs_read(path_name => '/QOpenSys/etc/inetd.conf')) WHERE line NOT LIKE '#%' ORDER BY line_number;
A good result
QIBM_QZDA_*) and FTP server (QIBM_QTMF_SERVER_REQ, QIBM_QTMF_SVR_LOGON) rows. A 0 means nothing filters that door. (The query lists every exit point with its count, so an empty door shows as 0, not as a missing row someone could read as "all clear".)AUTHORIZATION_NAME should be a system or service profile, not a named user);/ or a broad path. NetServer or NFS running with nothing shared is fine.Watch for
exit_point_info has no column that counts them.On IBM i: Object security + adopted authority: done right, decades early
The check. List every profile with *ALLOBJ, held directly or through its group profile (QSYS2.USER_INFO shows each profile's special authorities and its group), and ask who knows each service profile's password. Those are the identities an agent must never borrow.
-- *ALLOBJ held directly, or through the group profile, and whether the profile can sign on with a password
SELECT u.authorization_name, u.no_password_indicator, u.group_profile_name,
CASE WHEN u.special_authorities LIKE '%*ALLOBJ%' THEN 'direct' ELSE 'through group' END AS how
FROM qsys2.user_info u
LEFT JOIN qsys2.user_info g ON g.authorization_name = u.group_profile_name
WHERE u.status = '*ENABLED'
AND (u.special_authorities LIKE '%*ALLOBJ%' OR g.special_authorities LIKE '%*ALLOBJ%')
ORDER BY how, u.authorization_name;A good result
no_password_indicator is YES (they can't be signed on with a password).NO on anything other than the security officer and named administrators.The second half, a profile that several people or jobs share, can't be found by a query. It's the question: who knows this password?
Job descriptions that name a user. A job description with a user in it lets whoever can use it submit batch work that runs as that user:
SELECT j.job_description_library, j.job_description, j.authorization_name,
o.object_authority AS public_authority
FROM qsys2.job_description_info j
LEFT JOIN qsys2.object_privileges o
ON o.system_object_schema = j.job_description_library
AND o.system_object_name = j.job_description
AND o.object_type = '*JOBD'
AND o.authorization_name = '*PUBLIC'
WHERE j.authorization_name IS NOT NULL AND j.authorization_name <> '*RQD'
ORDER BY 4, 3;-- The security level decides how much the result matters SELECT system_value_name, current_character_value FROM qsys2.system_value_info WHERE system_value_name = 'QSECURITY';
A good result
No job description that names a powerful profile (QSECOFR or any *ALLOBJ profile) has *PUBLIC *USE or *CHANGE. At security level 40 or 50, IBM i also requires the submitter to have *USE on the named profile, so a public job description is a gap mainly at level 30 or below. *PUBLIC *CHANGE is worse at any level: anyone can change what the job runs and from which libraries. The column is AUTHORIZATION_NAME; there is no USER_PROFILE column.
Watch for
current_character_value. The number column comes back empty for it.On IBM i: Journaling + commitment control: reversibility in the transaction
The check. Pick the ten files an agent would write to first. Confirm each is journaled with both before and after images (IMAGES(*BOTH)), and whether the programs that update them run under commitment control.
-- Data files in the application library: journaled, and with which images
SELECT o.objname, o.objlongname, o.journaled, o.journal_library, o.journal_name, o.journal_images
FROM TABLE(qsys2.object_statistics('<APPLIB>', '*FILE')) o
JOIN qsys2.systables t
ON t.system_table_schema = '<APPLIB>' AND t.system_table_name = o.objname
WHERE o.objattribute = 'PF' AND t.file_type = 'D'
ORDER BY o.journaled, o.journal_images, o.objname;A good result
Each of your ten files shows YES and *BOTH.
*AFTER means a change can be replayed forward but not removed.NO means there's no record of the change at all.Commitment control is a question about the programs (how each was compiled and started), not something a query on the file shows.
On IBM i: User profiles + audit journal (QAUDJRN)
The check. Confirm security auditing is on (DSPSECAUD), then name who reads QAUDJRN and how often. An audit journal nobody reads cannot tell you what an agent did.
-- Auditing switched on, and what it records
SELECT system_value_name, current_character_value
FROM qsys2.system_value_info
WHERE system_value_name IN ('QAUDCTL', 'QAUDLVL', 'QAUDLVL2');-- Authority failures in the last 7 days, by user: if nobody can say what these were, nobody reads the journal SELECT user_name, COUNT(*) AS failures, MAX(entry_timestamp) AS latest FROM TABLE(systools.audit_journal_af(starting_timestamp => CURRENT TIMESTAMP - 7 DAYS)) GROUP BY user_name ORDER BY failures DESC;
A good result
QAUDCTL includes *AUDLVL, and QAUDLVL includes at least *AUTFAIL and *SECURITY;Platform maturity · whether an agent can reach in
On IBM i: The integration / modernization surface: where the platform hands you nothing
The check. Name one business function an outside program can call today without a 5250 screen: a service program, a stored procedure or an API. If you cannot name one, that is the first thing to build.
-- SQL procedures and functions in the application library, by name (what an outside program can call) SELECT routine_name, routine_type, CAST(long_comment AS VARCHAR(100)) AS description FROM qsys2.sysroutines WHERE routine_schema = '<APPLIB>' ORDER BY routine_name;
-- Service programs (callable ILE business logic)
SELECT objname, objtext
FROM TABLE(qsys2.object_statistics('<APPLIB>', '*SRVPGM'))
ORDER BY objname;A good result
At least one procedure or service program that does a real business step (a credit check, an order status), not only utilities. Zero rows from both is the honest answer that the logic is still behind screens.
On IBM i: Db2 for i reachable by SQL/services vs trapped behind RPG
The check. Take one core file and ask whether someone could query it in SQL, with names they would understand, without reading the RPG. Long names, constraints and views are what to look for.
-- For each data file: an SQL long name, a description, a primary key, and how many views sit over it
SELECT t.system_table_name, t.table_name AS sql_name, t.table_text,
(SELECT COUNT(*) FROM qsys2.syscst c
WHERE c.table_schema = t.table_schema AND c.table_name = t.table_name
AND c.constraint_type = 'PRIMARY KEY') AS primary_key,
(SELECT COUNT(*) FROM qsys2.sysviewdep v
WHERE v.table_schema = t.table_schema AND v.table_name = t.table_name) AS views_over_it
FROM qsys2.systables t
WHERE t.table_schema = '<APPLIB>' AND t.file_type = 'D'
AND t.table_type IN ('T', 'P') -- tables and DDS physical files only (otherwise the schema's own SYS* catalog views show up)
ORDER BY t.system_table_name;A good result
The core files have an SQL name different from the 10-character system name (or the same name when it already fits) (or a view with readable column names over them), a description, and a primary key. A file where all three are empty is one only its RPG can explain.
On IBM i: Change control · staged promotion · scoped automation identities
The check. Trace how one change reaches production today: who promotes it, under which profile, and whether a scheduled job could make the same change unreviewed.
-- Objects in the application library changed in the last 30 days, and who created and owns them
SELECT objname, objlongname, objtype, change_timestamp, objdefiner AS created_by, objowner AS owner
FROM TABLE(qsys2.object_statistics('<APPLIB>', '*ALL'))
WHERE change_timestamp > CURRENT TIMESTAMP - 30 DAYS
AND objtype <> '*JRNRCV'
ORDER BY change_timestamp DESC;-- Scheduled jobs: a count first, so an empty scheduler shows as 0 rather than a blank
SELECT COUNT(*) AS all_jobs,
SUM(CASE WHEN command_string LIKE '%<APPLIB>%' THEN 1 ELSE 0 END) AS applib_jobs
FROM qsys2.scheduled_job_info;-- Then the jobs themselves SELECT scheduled_job_name, scheduled_by, status, command_string FROM qsys2.scheduled_job_info WHERE command_string LIKE '%<APPLIB>%';
A good result
Watch for
SCHEDULED_JOB_INFO shows every column only to a profile with *JOBCTL, or to the profile in SCHEDULED_BY.On IBM i: QAUDJRN / journal / system data: surfaced, or sitting unread
The check. Ask how you would know by tomorrow morning that an automated job changed 500 records it should not have. If the answer is that someone would notice, that is the gap.
-- Who changed rows, by file, user and program, across the current receiver chain
-- Filtering by object_name needs the 10-character system name,
-- so this version groups across the whole journal instead
SELECT object, job_user, "CURRENT_USER", program_name, COUNT(*) AS changes
FROM TABLE(qsys2.display_journal('<JRNLIB>', '<JRN>',
starting_receiver_name => '*CURCHAIN',
journal_codes => 'R'))
GROUP BY object, job_user, "CURRENT_USER", program_name
ORDER BY changes DESC;A good result
Every row change is under a profile you can name as one person or one agent, and every agent change goes through a procedure or service program rather than plain SQL (PROGRAM_NAME QZDASOINIT). The journal shows what an agent did; to show what it can do, run this and check that the agent profile and *PUBLIC have no authority on the tables, and the agent has authority only on the procedures, which reach the tables through adopted authority (USRPRF(*OWNER)):
SELECT system_object_name, object_type, authorization_name, object_authority
FROM qsys2.object_privileges
WHERE system_object_schema = '<APPLIB>' AND authorization_name IN ('<AGENT_PROFILE>', '*PUBLIC')
ORDER BY 1, 2, 3;To confirm the procedures adopt their owner's authority:
-- Change SP_% to the pattern your procedures are named by
SELECT o.system_object_name, o.authorization_name, o.object_authority, p.user_profile
FROM qsys2.object_privileges o
LEFT JOIN qsys2.program_info p
ON p.program_library = o.system_object_schema AND p.program_name = o.system_object_name
WHERE o.system_object_schema = '<APPLIB>' AND o.system_object_name LIKE 'SP_%'
ORDER BY 1, 2;Watch for
"CURRENT_USER": always in double quotes. Without the quotes, SQL reads it as the special register and returns the profile running the query on every row. The result looks believable and is wrong."CURRENT_USER", not JOB_USER. Database server jobs (QZDASOINIT) and Mapepire run under QUSER, so JOB_USER is QUSER for every remote change.PROGRAM_NAME shows the way in: a procedure or service program means the change went through the application's own logic, and QZDASOINIT means plain SQL written straight to the table.*CURCHAIN: check the date range it covers before trusting "who changed what".OBJECT_AUTHORITY means a custom mix of rights (often *OBJOPR plus *EXECUTE for a procedure), not a named level.Check eight areas before an agent connects: leakage prevention, workload identity, reversibility, human accountability, intelligence stack maturity, data legibility, autonomy discipline and observability. Each has a read-only SQL check on this page.
No. Every query on the page only reads. Run them under your own change and security rules.
Run them under a profile with *ALLOBJ or *SECADM. Several of the services show only what the person running them is allowed to see, so a normal user can get no rows and look clean when the system isn't.
The Agent-Ready Read scores the same eight areas in about three minutes, with no account needed, and shows which one is thinnest. Start with that check.
A check that comes back clean is evidence, and worth keeping. A check that doesn't is the first thing to fix before an agent gets a profile on the system. Start with the four safety controls: they decide what an agent can reach, what it can undo, and who answers for it.
Connecting an MCP server to Db2 for i? Before you connect the IBM i MCP server to an agent applies the same checks to the server, its profile and Mapepire.
If you would rather have the order worked out for you, the Agent-Ready Read asks the same eight questions and gives you a score, a verdict and the thinnest areas, with these checks attached.
Every query on this page only reads. Run them under your own change and security rules. Pegasus4i is an IBM Business Partner.