IBM Bob training course: setting BOB up properly for a real IBM i team
Every IBM i shop has rules. Some are written down in a dusty standards document last updated when the AS/400 was still beige. Most live in the heads of three senior developers and come out as a sharp intake of breath during code review. "We don't use indicators here." "Never, ever CLRPFM in production." "Who put a GOTO in this?"
BOB doesn't know any of that out of the box. It's very clever, but it's new here. So in this lesson we'll give it the induction every new starter should get:
- An
AGENTS.mdthat writes down your shop's coding standards, so BOB follows them on every task - Sensible auto-approve defaults for the team, so BOB can't run off and do things nobody approved
- A private temporary library, so BOB's (and your) temporary objects don't clash with anyone else's
Heads up: As usual, I quote IBM's docs where they say something, and mark my own reasoning as reasoning. Anything marked [CHECK] is worth a quick test on your own system before you roll it out to the whole team.
1. Where BOB looks for your rules
Last lesson I said we'd "write an AGENTS.md in QBOBSRC". Good news: that's exactly what IBM's docs say. But there's one detail worth getting right, because it trips people up:
QBOBSRClives in your current library. The path is{currentLibrary}/QBOBSRC/AGENTS.MD: source fileQBOBSRC, memberAGENTS, member typeMD.
So it isn't one system-wide file. It's one per application library, and BOB uses whichever one is in the current library of your Code for IBM i connection. Switch current library, and you switch rulebooks. I think that's rather sensible: the payroll team and the warehouse team probably don't share every rule.
IBM's docs list three places rules can come from, depending on the BOB workspace you're using:
| BOB workspace | Where the rules live | Notes |
|---|---|---|
| Library List | {currentLibrary}/QBOBSRC/AGENTS.MD | The classic IBM i option, and our focus here |
| IFS Working Directory | {ifsWorkingDirectory}/.bob/AGENTS.md | For IFS-based projects |
| Local (a Git clone on your PC) | AGENTS.md in the workspace root, plus .bob/rules/ and .bob/rules-{mode-slug}/ folders | Standard BOB rules, version-controlled with the code |
From IBM's docs, the two IBM i files (QBOBSRC and IFS) are loaded automatically into IBM i Developer and IBM i Database modes, and they're injected into every task. If you work in a Local Git workspace, BOB's general rules system applies: an AGENTS.md in the project root (switch it off with "bob-code.useAgentRules": false), rules files in .bob/rules/, and personal global rules in ~/.bob/rules/ (%USERPROFILE%\.bob\rules\ on Windows).
If your source is in Git and on the IBM i, keep one master copy of your standards and copy it to both places. Two rulebooks that slowly drift apart is a very IBM i way to make a mess.
2. Let BOB write the first draft: /init
You don't have to start from a blank member. The Premium Package for i has an /init slash command, available in both IBM i modes. According to IBM's docs it:
- Pre-flight checks that you've got a current library set. If your current library is an IBM-supplied one like
QGPLorQTEMP, it warns you and suggests switching to an application library first. (Good. Nobody wants their standards in QGPL.) - Analyses the workspace: source files, member types, ILE patterns (service programs, binding directories, activation groups), IWS definitions, database objects, journaling and naming conventions.
- Writes or updates
{currentLibrary}/QBOBSRC/AGENTS.MD, keeping any custom guidelines you've already added. - Loads the result straight away into every conversation in both IBM i modes, with no reconnect needed.
You can also give it instructions as you go:
My recommended approach: run /init first so BOB documents what's actually in the library, then add your shop rules by hand (section 4). /init describes how things are. Your rules describe how they should be.
3. Creating QBOBSRC yourself
If you'd rather create the source file yourself (or /init can't create it, for example because of authority), here's how. I'm using ORDLIB as the application library. Swap in your own.
TEXT('IBM Bob project rules (AGENTS.MD)')
ADDPFM FILE(ORDLIB/QBOBSRC) MBR(AGENTS) SRCTYPE(MD) +
TEXT('Shop coding standards for IBM Bob')
A few notes:
RCDLEN(240)gives you 228 characters of source data per line (the other 12 bytes are the sequence number and date). The default of 92 only gives you 80 characters, which is tight for markdown. Anything beyond the record length gets chopped off, so keep lines short either way. [CHECK] 240 is my choice, not an IBM requirement.- Member type
MDis what makes the member show up asAGENTS.MDin Code for IBM i, matching IBM's documented path. - CCSID: markdown uses
#,@and$, which are variant characters in some EBCDIC CCSIDs. Code for IBM i converts on the way in and out, so as long as your job CCSID isn't 65535 you should be fine. If your headings come back as rubbish, it's a CCSID problem (see the troubleshooting table). - Authority: developers need to read it and BOB acts as each developer, so
*PUBLIC *USEon the member is enough for most people. Keep*CHANGEfor whoever owns the standards. You don't want BOB "helpfully" rewriting its own rules.
GRTOBJAUT OBJ(ORDLIB/QBOBSRC) OBJTYPE(*FILE) USER(LEADDEV) AUT(*CHANGE)
[CHECK] Note that/initupdatesAGENTS.MD. If you lock the member down to*USE, then/initwill only work for users who have*CHANGE. That's arguably a feature.
Now open the member in Code for IBM i (Object Browser → ORDLIB → QBOBSRC → AGENTS.MD) and paste in your rules.
4. A complete example AGENTS.MD for an RPG shop
Here's a realistic one. It's based on the standards I push at clients, so take it, argue with it, and make it yours. Keep it short, specific and testable. "Write good code" is useless to BOB. "Never use numbered indicators" isn't.
## About this application
- ORDLIB is the order-processing application (orders, order lines, delivery).
- Development library list: ORDLIB, ORDDTA_DEV, UTILLIB.
- Production libraries are ORDLIB_P and ORDDTA. Never read from, write to,
compile into or run commands against them. If a task needs them, stop and ask.
## Golden rules (never break these)
- Never run DLTxxx commands (DLTPGM, DLTF, DLTLIB, DLTOBJ, DLTSRVPGM, etc.).
- Never run CLRPFM, CLRLIB, RGZPFM, RMVM, or SQL DROP, TRUNCATE or DELETE
without a WHERE clause.
- Never run CHGUSRPRF, GRTOBJAUT, RVKOBJAUT, CHGOBJOWN or any security command.
- Never change system values, subsystems, job queues or IPL settings.
- Never touch libraries starting with Q, or SYSIBM, SYSTOOLS, SYSPROC.
- Never put passwords, keys or real customer data into source or comments.
- Always show me the full change (diff) and explain it before writing a member.
- If you are unsure, ask. Do not guess object names, column names or libraries.
## RPG standards
- New and changed RPG is fully free-form: first line is **FREE.
- No fixed-form specs, no H/F/D/C specs, no GOTO, no TAG, no CABxx.
- No numbered indicators (*IN01 to *IN99) and no indicator-based logic.
Use named indicators (dcl-s ... ind) or %FOUND, %EOF, %ERROR.
Display files use INDARA with a named indicator data structure.
- Programs use: ctl-opt dftactgrp(*no) actgrp(*new) option(*srcstmt:*nodebugio).
Service program modules use ctl-opt nomain; bind them with ACTGRP(*CALLER).
- Use subprocedures, not subroutines. One job per procedure.
- Declare everything with dcl-s, dcl-ds, dcl-c, dcl-pr, dcl-pi.
Use LIKEDS and LIKE, and qualified data structures.
- Use EXTPROC/EXTPGM prototypes from copybooks in UTILLIB/QPROTOSRC.
- Dates and times are ISO: datfmt(*iso) timfmt(*iso). No 6-digit dates.
- Indent with 2 spaces. Keywords in lower case. Max line length 100.
## Naming conventions
- Programs: ORDnnnR (RPG), ORDnnnC (CL), ORDnnnD (display file).
- Service programs: SRV_ prefix, e.g. SRV_ORDER. Modules match the service program.
- Procedures: verbNoun in camelCase, e.g. getOrderHeader, calcDeliveryDate.
- Variables: camelCase. Constants: UPPER_SNAKE_CASE. Work fields never start with #, @ or $.
- Data structure templates end in _t and use template, e.g. orderHeader_t.
## Comment header (every source member)
Every member starts with this header, kept up to date:
// ---------------------------------------------------------------
// Program : ORD120R
// Purpose : One line describing what it does
// Author : Name Created : YYYY-MM-DD
// Changes : YYYY-MM-DD Name Ticket Short description
// ---------------------------------------------------------------
Add a short comment above each procedure explaining what it does and its
parameters. Do not comment the obvious.
## Embedded SQL
- Prefer embedded SQL over record-level access for new code.
- Every SQLRPGLE program starts with:
exec sql set option commit = *chg, closqlcsr = *endmod,
datfmt = *iso, naming = *sys;
- Always use host variables / parameter markers. Never build SQL by
concatenating values. Dynamic SQL uses PREPARE with ? markers.
- Never use SELECT *. List the columns.
- Check SQLSTATE after every statement: '00000' ok, '02000' not found,
anything else is an error. Use GET DIAGNOSTICS for the message text.
- Cursors are always closed, including on error paths.
## Commitment control
- ORDDTA_DEV files are journaled. All updates run under commitment control
(commit = *chg).
- One business transaction = one COMMIT. ROLLBACK on any error.
- Never COMMIT inside a loop that processes more than one order.
## Error handling
- Wrap file and SQL work in MONITOR / ON-ERROR / ENDMON.
- Never use an empty ON-ERROR. Log the error with UTILLIB's logError()
procedure (program, procedure, message ID, text), then return an error
status to the caller.
- Programs return a status parameter (char(1): '0' ok, '1' error) rather
than sending escape messages, unless they are called from CL.
## CL standards
- CL is ILE CL (CLLE), not OPM CLP.
- Every CL program has a global MONMSG CPF0000 that jumps to an error routine
which sends the message on with SNDPGMMSG ... MSGTYPE(*ESCAPE).
- Declare all variables with DCL. Use &lower_case names.
- Library-qualify system commands (QSYS/...), like Bob's guardrail expects.
- No hard-coded library names; use the library list.
## Db2 for i conventions
- New tables are created with SQL DDL, not DDS. Store DDL in ORDLIB/QSQLSRC.
- Table names: long SQL name plus a 10-character FOR SYSTEM NAME,
e.g. ORDER_HEADER FOR SYSTEM NAME ORDHDR.
- Every table has a primary key, and audit columns:
CREATED_AT, CREATED_BY, CHANGED_AT, CHANGED_BY.
- Add LABEL ON TABLE and LABEL ON COLUMN text for every table and column.
- Use DECIMAL for money, DATE/TIMESTAMP for dates. Never CHAR dates.
## Compiling
- Compile into ORDLIB only. Always use OPTION(*EVENTF) so errors show up.
- Use the standard Code for IBM i actions; do not invent new compile commands.
## When you finish a task
- Summarise what changed, which members, and anything I need to test.
- Suggest a /review_rpg or /review_SQL if you changed RPG or SQL.
A few comments on why it's written like this:
- The golden rules come first. I'd like to think the model reads to the end, but I'd rather the important bits came at the top.
- It's a rulebook, not a guardrail. An
AGENTS.mdasks BOB to behave. It doesn't stop it. The real stops are your user profile's authority and the approval settings in section 5. Belt and braces. - It names things. Real library names, real procedure names, real prefixes. The more concrete, the more consistent BOB's output.
- Watch the line lengths. Every line in that example is under 100 characters, so it fits comfortably in an
RCDLEN(240)source file.
Did BOB actually pick it up?
From IBM's docs, the rules are injected into every task in the IBM i modes. Here's how I check:
- In Code for IBM i, make sure your current library is
ORDLIB(the User Library List view shows it). - In BOB, start a new task in IBM i Developer mode, with the Library List workspace selected.
- Ask: "What are the golden rules in this project's AGENTS.md? Quote them exactly."
- Then test a rule: "Write me a small RPG program that reads ORDHDR and counts open orders." It should come back free-form, with
**FREE, no indicators, SQL with host variables, a MONITOR block and your comment header. If it doesn't, something's wrong. - Try a naughty one: "Clear the ORDHDR file in ORDDTA." BOB should refuse, or at least stop and ask, quoting the rule. (And thanks to section 5, it can't do it without an approval card anyway.)
[CHECK] IBM's docs don't say what, if anything, appears in the output channels when AGENTS.MD is loaded, so the conversation test is the reliable one.5. Sensible auto-approve defaults for the team
How BOB's approvals work (quick recap)
From IBM's auto-approve docs, there are four controls:
| Control | Where | Scope |
|---|---|---|
| Tool-group auto-approval | Permissions button beside the Mode selector (current task), or Settings → Tool Auto-approval (defaults for new tasks) | Per task |
| Allowed and Denied Commands | Settings → Execute | Global, for terminal commands |
| MCP Always Allow | Approval card, or MCP server settings | Task or global |
| One-time approval | Approve on an approval card | One call |
There's also a master toggle: switch auto-approval off in the Permissions menu and none of the group toggles apply.
And here's how BOB's IBM i tools map onto the groups (from the Premium Package Tools page):
- Read:
read_member,search_qsys,read_stream_file,search_ifs - Write (Edit):
write_member,write_stream_file,generate_dds - Execute:
execute_cl_command,execute_sql_statement,execute_pase_command,manage_library_list,convert_rpg_source, the build tools and the SQL lookup tools (get_table_columnsand friends) - Documentation and Understand: their own extra groups in the IBM i modes
My recommended defaults
IBM's quickstart suggests starting with only Read auto-approved, and IBM rates Edit and Execute as high risk. I agree, and I'd add a few low-risk ones so BOB isn't nagging you about its todo list.
| Group | Auto-approve? | Why |
|---|---|---|
| Read | Reading source and IFS files. It can only read what your profile can read. | |
| Documentation | IBM i docs, CL command help and SQL examples. Nothing changes. | |
| Understand | Querying the scan data. Read-only. | |
| Todo, Subtask, Mode | Rated low risk by IBM. Workflow housekeeping only. | |
| Subagent | IBM rates it low risk: it's about delegating work, not direct system access. | |
| Skill | Medium risk. Skills only steer BOB within its existing tools, so I leave it on. | |
| Edit (write members/IFS) | You should see the diff for every member BOB writes. Every time. | |
| Execute (CL, SQL, PASE, compiles) | This is a command line on your IBM i. Turn it on per task, on a dev partition, when you're actively watching. | |
| MCP | Depends entirely on what the MCP server can do. Approve individual tools with Approve for task. |
The Execute trade-off: BOB's SQL lookup tools (like get_table_columns, which IBM says BOB calls before running SQL against a table it doesn't know) sit in the Execute group too. So with Execute off you'll approve a few harmless catalog queries. I'd rather click Approve a few times than have a robot with a command line and no supervision. If it drives you mad, turn Execute on for that task only, and lean on the guardrails below.The IBM i guardrails: belt and braces
These are the Premium Package for i settings (Preferences: Open Settings (UI) → Extensions → IBM Bob Premium Package for i). They work even when Execute is auto-approved:
| Setting ID | Default | My recommendation |
|---|---|---|
vscode-ibmi-bob.guardrails.enforceQualifiedCLCommands | true | Leave on. BOB must use QSYS/CRTBNDRPG rather than CRTBNDRPG, so a rogue copy of a command earlier in the library list can't hijack it. |
vscode-ibmi-bob.guardrails.deniedSQLStatementTypes | ALLOCATE, CALL, COMMIT, CONNECT, DISCONNECT, DROP, EXECUTE, GRANT, LOCK, MERGE, PREPARE, RENAME, REVOKE, ROLLBACK, SAVEPOINT, TRUNCATE, UPDATE | Add DELETE, INSERT, ALTER and CREATE. Look closely: DELETE isn't in the default list! These types always need your approval, whatever the auto-approve settings. |
vscode-ibmi-bob.general.maxRowsToFetch | 100 | Leave at 100, or lower it on systems with sensitive data. IBM warns that bigger values slow things down and can "poison" the context, and every row BOB fetches ends up in the conversation. |
Here's how that looks in your VS Code settings.json (Preferences: Open User Settings (JSON)):
"vscode-ibmi-bob.guardrails.enforceQualifiedCLCommands": true,
"vscode-ibmi-bob.guardrails.deniedSQLStatementTypes": [
"ALLOCATE", "ALTER", "CALL", "COMMIT", "CONNECT", "CREATE", "DELETE",
"DISCONNECT", "DROP", "EXECUTE", "GRANT", "INSERT", "LOCK", "MERGE",
"PREPARE", "RENAME", "REVOKE", "ROLLBACK", "SAVEPOINT", "TRUNCATE",
"UPDATE"
],
"vscode-ibmi-bob.general.maxRowsToFetch": 100
}
[CHECK] IBM documents the setting IDs and the default list, but not the full set of valid statement-type names.DELETE,INSERT,ALTERandCREATEare the obvious SQL statement keywords, but test one (ask BOB to run a harmlessINSERTinto a scratch table) and make sure you get an approval card before relying on it.
Rolling it out to the whole team
This is where you have to be honest about what the tools allow:
- Shared guardrail settings. The
vscode-ibmi-bob.*settings are ordinary VS Code-style settings, so you can hand out a standardsettings.jsonsnippet, or put them in a Git project's.vscode/settings.jsonfor Local workspaces. [CHECK] IBM doesn't say whether these settings can be set at workspace level, so confirm that a workspace value really overrides the user value. - Auto-approve defaults live in each person's Settings → Tool Auto-approval. IBM doesn't document a settings file key for them, so for most teams this is a "set this on day one" checklist item, ideally done together in the induction session.
- Enforcing it (the grown-up option). If you have IT on side, BOB supports enterprise group policies on Windows (Registry
Software\Policies\IBM\Bob, via GPO or Intune), macOS (managed preferencescom.ibm.bob, via MDM) and Linux (/etc/bob/policy.json). TheDisabledAutoApprovalGroupspolicy permanently disables auto-approval for the groups you list, and locks the toggles in the UI:
On Linux that would be { "DisabledAutoApprovalGroups": "edit,execute" } in /etc/bob/policy.json, but remember IBM only supports BOB on Windows and Apple Silicon Macs. [CHECK] the exact value format against IBM's sample policy files for your platform.
Policies can only switch auto-approval off, not on. That's exactly what you want: the safe default is enforced, and everyone still gets an approval card to click.
6. A private temporary library for BOB (and you)
Why bother?
Code for IBM i needs a temporary library for its working objects. The default is ILEDITOR, and everyone shares it. IBM's Bob security guidelines say so directly, and recommend "specifying your own individual temporary library and excluding access by all other users." The Code for IBM i security page goes further: the components it keeps there "are not secure by default and may be subject to attacks like security escalation."
Three reasons to go private:
- Security. A shared library everyone can change is a shared library anyone can tamper with.
- No clashes. My reading of the Code for IBM i source: with Clear temporary data automatically switched on, it runs
DLTOBJ OBJ(<templib>/O_*) OBJTYPE(*FILE)on connect. In a shared library, that means your connect can delete my temporary files, possibly while I'm using them. In a private library, the only temporary files it deletes are yours. (That's my reasoning from the code, not an IBM statement.) - Tidiness and auditing. You know exactly whose objects are whose, and when someone leaves, you delete one library.
Step 1: create the library
One per developer. I use C4I plus a short user name, which stays within the 10-character limit:
CRTLIB LIB(C4INICK) TYPE(*TEST) AUT(*EXCLUDE) CRTAUT(*EXCLUDE) + TEXT('Code for IBM i / BOB temp library for NICK')
AUT(*EXCLUDE)means*PUBLICcan't get at the library.CRTAUT(*EXCLUDE)means objects created in it default to*PUBLIC *EXCLUDEtoo.TYPE(*TEST)is a small hint that this isn't production. [CHECK] Your shop may have its own standards here.
Step 2: make sure the right person owns it
If Nick runs the CRTLIB, Nick normally owns it, and that's all you need. Two gotchas:
- If an admin creates it for you, change the owner:
CHGOBJOWN OBJ(C4INICK) OBJTYPE(*LIB) NEWOWN(NICK) - If your user profile has
OWNER(*GRPPRF), new objects are owned by your group profile, so every member of the group gets in. Check withDSPUSRPRF USRPRF(NICK), and useCHGOBJOWNif needed.
Code for IBM i itself needs at least *CHANGE authority to the library. From the source, it checks this with CHKOBJ ... AUT(*CHANGE) on connect and refuses to use the library if the check fails.
Check the result:
DSPOBJAUT OBJ(C4INICK) OBJTYPE(*LIB)
or, the SQL way:
SELECT AUTHORIZATION_NAME, OBJECT_AUTHORITY, OWNER
FROM QSYS2.OBJECT_PRIVILEGES
WHERE SYSTEM_OBJECT_SCHEMA = 'QSYS'
AND SYSTEM_OBJECT_NAME = 'C4INICK'
AND OBJECT_TYPE = '*LIB';
You want to see NICK with *ALL and *PUBLIC with *EXCLUDE.
Step 3: tell Code for IBM i (and so BOB)
In Code for IBM i: IBM i: Servers view → right-click your connection → Connection Settings → Temporary Data tab:
| Field | Set it to | Notes |
|---|---|---|
| Temporary library | C4INICK | Max 10 characters. Can't be QTEMP. If it doesn't exist, Code for IBM i tries to create it (with default authorities, so create it yourself first as above). |
| Temporary IFS directory | ~/.vscode/tmp (the default) | Already private if your home directory is. If you change it, make sure only you can access it. |
| Clear temporary data automatically | Deletes O_* files in the temp library and vscodetemp* files in the temp directory. Safe now the library is yours. |
Save, then disconnect and reconnect. (A change to the temporary IFS directory needs a reconnect anyway.) You'll see the library being checked in the connection progress messages, and BOB will pick it up straight away, because IBM's docs say the temporary library and IFS directory are part of the connection context BOB gets on every task.
Docs note: the Code for IBM i connection settings page still lists/tmpas the default temporary IFS directory, but the code (and IBM's Bob security guidelines) use~/.vscode/tmp. In fact Code for IBM i quietly changes/tmpto~/.vscode/tmp. Go with~/.vscode/tmp.
What about the team-shared option?
If per-user libraries are too much admin, the Code for IBM i security guide offers a group-owned shared library: create a group profile with no special authorities (e.g. GRPDEV), put the developers in it, make it the owner of ILEDITOR, and set *PUBLIC *EXCLUDE. That stops outsiders getting in, but as the guide says, everyone in the group can see each other's stuff. And from my reading of the code, it doesn't fix the clearing clash. Per-user is better.
And a gotcha for admins: you can push connection settings to everyone with /etc/vscode/settings.json (a codefori object). But those values apply to every user and become read-only in the UI. That's great for forcing a setting, but no good for per-user library names. [CHECK]
Housekeeping
- Find all Code for IBM i temp libraries. From the source, Code for IBM i tags its temp libraries with the user-defined attribute
CODE4ITEMP:
SELECT OBJNAME, OBJOWNER, OBJTEXT
FROM TABLE(QSYS2.OBJECT_STATISTICS('QSYS', '*LIB'))
WHERE USER_DEFINED_ATTRIBUTE = 'CODE4ITEMP';
- Leavers: when someone leaves,
DLTLIB LIB(C4IJOHN). (You do this, not BOB. See the golden rules!) - Replication: Code for IBM i's docs say there's no need to replicate the temporary library or directory. Tell whoever looks after MIMIX, iTERA or similar to exclude
C4I*. - Backups: there's nothing in there worth saving. Leave it out of your save strategy.
7. Hands-on exercise: induct BOB
Allow about 30 minutes and one cup of tea.
- Private temp library. Create
C4I<you>withCRTLIB ... AUT(*EXCLUDE) CRTAUT(*EXCLUDE). Check it withDSPOBJAUT. Set it in Connection Settings → Temporary Data, tick Clear temporary data automatically, and reconnect. In the Code for IBM i output channel, find the line where your library is checked. - Guardrails. Add the
settings.jsonblock from section 5, includingDELETEandINSERT. - Auto-approve defaults. In Settings → Tool Auto-approval, set the defaults from the table in section 5 (Read, Documentation, Understand, Todo, Subtask, Subagent and Mode on; Edit, Execute and MCP off).
- Rules. Set your current library to a development library. Run
/init, then add the golden rules and RPG standards from section 4 toQBOBSRC/AGENTS.MD. - Test the rules. In a new IBM i Developer task, ask BOB to "quote the golden rules", then to "write a program that lists open orders". Check the result against your standards.
- Test the guardrails. Turn Execute on for this task only, then ask BOB to "insert a test row into a scratch table" (create one first in your dev library). You should still get an approval card, because
INSERTis now a denied statement type. Click Deny. Feels good, doesn't it? - Test the authority. Ask BOB to "list the objects in C4I<colleague>". It should fail with an authority error, because BOB is you, and you can't see your colleague's library.
8. Troubleshooting
| Symptom | Likely cause and fix |
|---|---|
| BOB ignores my AGENTS.MD | Check the current library is the one with QBOBSRC. Check the member is called AGENTS, type MD. Check you're in IBM i Developer or IBM i Database mode and the right workspace. Start a new task. |
/init says my current library is a system library | Exactly as IBM designed it. Change your current library to an application library and run it again. |
/init fails to write AGENTS.MD | Your profile probably lacks *CHANGE to QBOBSRC (or can't create it in the library). Create it as in section 3, or ask the rules owner. |
| Lines in AGENTS.MD are cut off | The record length is too short. Recreate QBOBSRC with RCDLEN(240), or keep lines shorter. |
# headings look like rubbish | A CCSID mismatch. Check your user profile CCSID isn't 65535, and check the source file CCSID. |
| Rules followed in the Local workspace but not on IBM i (or vice versa) | They're different files: root AGENTS.md and .bob/rules/ for Local, QBOBSRC/AGENTS.MD for the Library List. Keep them in sync. |
| "Temporary library ... exists but it cannot use as you don't have *CHANGE authority on it" | You set a library you're not authorised to. Fix the owner or authority (section 6, step 2). |
| "Could not create temporary library ... using ... instead" | Code for IBM i couldn't create your temp library, so it's using your current library instead. Create the library yourself first. |
| Colleague can still see my temp library | Check *PUBLIC is *EXCLUDE, and check your profile's OWNER setting: if it's *GRPPRF, the group owns your objects. |
| BOB runs an UPDATE without asking | Either UPDATE has been removed from deniedSQLStatementTypes, or the setting is being overridden somewhere (user vs workspace). Check both. |
| Approval toggles are greyed out | A group policy (DisabledAutoApprovalGroups) is in force. That's IT, not a bug. |
Key takeaways
-
AGENTS.MDlives inQBOBSRCin your current library (or.bob/AGENTS.mdin the IFS working directory), and IBM's docs say it's injected into every task in the IBM i modes./initwrites a first draft, keeping your custom rules. - Write rules that are short, concrete and testable: real library names, real prefixes, and golden rules first. But remember rules ask, they don't enforce.
- Auto-approve Read (plus the low-risk housekeeping groups), and always ask for Edit, Execute and MCP. Use
DisabledAutoApprovalGroupsgroup policies if you need to enforce it. - The guardrails work even with Execute switched on. Keep
enforceQualifiedCLCommandson, addDELETE,INSERT,ALTERandCREATEtodeniedSQLStatementTypes, and keepmaxRowsToFetchmodest. - Give everyone a private temp library (
CRTLIB ... AUT(*EXCLUDE) CRTAUT(*EXCLUDE)) instead of the sharedILEDITOR, set it in Connection Settings → Temporary Data, and switch on automatic clearing. - Above all: BOB is you. Least-privilege profiles on a development partition are still the most important guardrail of all.
Quick quiz
- Where does BOB look for project rules in a Library List workspace?
- A)
QGPL/QBOBSRC/AGENTS.MD, shared by the whole system - B)
{currentLibrary}/QBOBSRC/AGENTS.MD - C)
/etc/vscode/AGENTS.mdin the IFS
- A)
- What does
/initdo ifAGENTS.MDalready exists?- A) Refuses to run until you delete it
- B) Overwrites it completely with a fresh analysis
- C) Updates it with new findings and keeps your custom guidelines
- Which SQL statement type is not in the default
deniedSQLStatementTypeslist?- A)
DELETE - B)
DROP - C)
UPDATE
- A)
- You've turned on Execute auto-approval for a task. BOB tries to run
DROP TABLE. What happens?- A) It runs straight away, because Execute is approved
- B) You get an approval card, because
DROPis a denied statement type - C) BOB switches to Plan mode
- Which group policy stops users from switching on auto-approval for edits and commands?
- A)
DisabledAutoApprovalGroupsset toedit,execute - B)
UpdateModeset tonone - C)
GatewayUrlset to an internal server
- A)
- Why is a private temp library better than the shared
ILEDITOR?- A) Code for IBM i runs faster with a short library name
- B) It stops other users tampering with or clearing your temporary objects
- C) It's required by IBM i 7.6
- What's the minimum authority Code for IBM i needs to the temporary library?
- A)
*USE - B)
*CHANGE - C)
*ALLOBJspecial authority
- A)
- B. IBM's docs give the path as
{currentLibrary}/QBOBSRC/AGENTS.MD, so it's per application library, not system-wide./etc/vscode/holds Code for IBM i system settings, not BOB rules. - C. IBM says
/init"updates it with the latest findings while preserving any custom guidelines or manual edits you previously added." - A.
DROPandUPDATEare in the default list, butDELETEisn't. That's why this lesson recommends adding it (plusINSERT,ALTERandCREATE). - B. Denied statement types "always require explicit user approval ... even if they have granted execute auto-approve permission for the task."
- A.
DisabledAutoApprovalGroupspermanently disables auto-approval for the listed groups and locks the toggles.UpdateModecontrols updates, andGatewayUrlcontrols the backend address. - B. IBM's security guidelines recommend an individual temp library with other users excluded. And with automatic clearing on, a shared library means one user's connect can delete another user's
O_*files. - B. On connect, Code for IBM i checks
*CHANGEauthority to the temporary library and won't use it without that.*ALLOBJis exactly what you don't want a developer profile to have.
Next steps
BOB now knows your rules, asks before it changes anything, and has a library of its own. Next time we'll use all of that for real work: a guided fixed-format to free-format conversion of a genuine old RPG program, using BOB's IBM i workflows and /review_rpg. And we'll keep score against the AGENTS.MD we wrote today. Before then, finish the quiz and get at least one colleague to do it too.
Standards only work if everyone uses them. Just like the office kettle.
