Examples and guides for using the OpenAI API
<svg xmlns="http://www.w3.org/2000/svg" width="1440" height="1715" viewBox="0 0 1440 1715" role="img" aria-labelledby="title description">
<title id="title">SRE agent workflow</title>
<desc id="description">Incident alerts to Incident bot: Send incident. Incident bot to Slack #oncall: Open incident thread. Incident bot to Agents API: Create incident session. Incident bot to Incident sandbox: Start executor + AWS skills. Agents API to Incident sandbox: Read skills + runbook. Agents API to Evidence + history: Inspect code, AWS + history. Evidence + history to Agents API: Return correlated evidence. Agents API to Incident bot: Action-required webhook. Incident bot to Agents API: Fetch pending tool call. Incident bot to Slack #oncall: Post approval buttons. Slack #oncall to Incident bot: Approve or reject. Incident bot to Agents API: Submit decision. Agents API to Slack #oncall: Explain next steps. Slack #oncall to Incident bot: Ask a follow-up. Incident bot to Agents API: Continue same session. Incident bot to Incident bot: Save incident memory. Incident bot to Agents API: Delete session. Incident bot to Incident sandbox: Remove sandbox.</desc>
<defs><marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto-start-reverse" markerUnits="userSpaceOnUse"><path d="M 0 0 L 10 5 L 0 10 Z" fill="#253443"/></marker></defs>
<rect width="1440" height="1715" fill="#FFFFFF"/>
<g font-family="Arial, Helvetica, sans-serif">
<text x="24" y="46" text-anchor="start" font-size="26" font-weight="600" fill="#162231"><tspan x="24" dy="0">SRE agent</tspan></text>
<rect x="24" y="80" width="220.33333333333334" height="1556.3999999999999" fill="#F4F5F6"/>
<rect x="24" y="80" width="220.33333333333334" height="78" fill="#E4E6E9"/>
<text x="134.16666666666669" y="125.05" text-anchor="middle" font-size="23" font-weight="600" fill="#162231"><tspan x="134.16666666666669" dy="0">Incident alerts</tspan></text>
<path d="M 134.16666666666669 158 V 1636.3999999999999" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<rect x="258.33333333333337" y="80" width="220.33333333333334" height="1556.3999999999999" fill="#EDF7FE"/>
<rect x="258.33333333333337" y="80" width="220.33333333333334" height="78" fill="#CCE6FA"/>
<text x="368.5" y="125.05" text-anchor="middle" font-size="23" font-weight="600" fill="#162231"><tspan x="368.5" dy="0">Slack #oncall</tspan></text>
<path d="M 368.5 158 V 184" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<path d="M 368.5 216.6 V 1636.3999999999999" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<rect x="492.6666666666667" y="80" width="220.33333333333334" height="1556.3999999999999" fill="#EDF7FE"/>
<rect x="492.6666666666667" y="80" width="220.33333333333334" height="78" fill="#CCE6FA"/>
<text x="602.8333333333334" y="125.05" text-anchor="middle" font-size="23" font-weight="600" fill="#162231"><tspan x="602.8333333333334" dy="0">Incident bot</tspan></text>
<path d="M 602.8333333333334 158 V 1121.6000000000001" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<path d="M 602.8333333333334 1154.2 V 1356" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<path d="M 602.8333333333334 1417.2 V 1636.3999999999999" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<rect x="727" y="80" width="220.33333333333334" height="1556.3999999999999" fill="#EEFBF3"/>
<rect x="727" y="80" width="220.33333333333334" height="78" fill="#CDF2DB"/>
<text x="837.1666666666667" y="125.05" text-anchor="middle" font-size="23" font-weight="600" fill="#162231"><tspan x="837.1666666666667" dy="0">Agents API</tspan></text>
<path d="M 837.1666666666667 158 V 418.4" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<path d="M 837.1666666666667 451 V 1557.8" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<path d="M 837.1666666666667 1590.3999999999999 V 1636.3999999999999" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<rect x="961.3333333333334" y="80" width="220.33333333333334" height="1556.3999999999999" fill="#FFFCED"/>
<rect x="961.3333333333334" y="80" width="220.33333333333334" height="78" fill="#FFF0B3"/>
<text x="1071.5" y="125.05" text-anchor="middle" font-size="23" font-weight="600" fill="#162231"><tspan x="1071.5" dy="0">Incident sandbox</tspan></text>
<path d="M 1071.5 158 V 555.6" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<path d="M 1071.5 588.2 V 624.2" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<path d="M 1071.5 656.8000000000001 V 1636.3999999999999" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<rect x="1195.6666666666667" y="80" width="220.33333333333334" height="1556.3999999999999" fill="#EDF7FE"/>
<rect x="1195.6666666666667" y="80" width="220.33333333333334" height="78" fill="#CCE6FA"/>
<text x="1305.8333333333335" y="110.1" text-anchor="middle" font-size="23" font-weight="600" fill="#162231"><tspan x="1305.8333333333335" dy="0">Evidence +</tspan><tspan x="1305.8333333333335" dy="29.900000000000002">history</tspan></text>
<path d="M 1305.8333333333335 158 V 1636.3999999999999" fill="none" stroke="#A8B3BC" stroke-width="1" stroke-dasharray="6 6"/>
<g data-from="0" data-to="2"><path d="M 134.16666666666669 222.6 H 602.8333333333334" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="368.5" y="208" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="368.5" dy="0">Send incident</tspan></text></g>
<g data-from="2" data-to="1"><path d="M 602.8333333333334 291.2 H 368.5" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="485.6666666666667" y="276.6" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="485.6666666666667" dy="0">Open incident thread</tspan></text></g>
<g data-from="2" data-to="3"><path d="M 602.8333333333334 388.4 H 837.1666666666667" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="720" y="345.2" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="720" dy="0">Create incident</tspan><tspan x="720" dy="28.6">session</tspan></text></g>
<g data-from="2" data-to="4"><path d="M 602.8333333333334 457 H 1071.5" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="837.1666666666667" y="442.4" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="837.1666666666667" dy="0">Start executor + AWS skills</tspan></text></g>
<g data-from="3" data-to="4"><path d="M 837.1666666666667 525.6 H 1071.5" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="954.3333333333334" y="511" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="954.3333333333334" dy="0">Read skills + runbook</tspan></text></g>
<g data-from="3" data-to="5"><path d="M 837.1666666666667 594.2 H 1305.8333333333335" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="1071.5" y="579.6" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="1071.5" dy="0">Inspect code, AWS + history</tspan></text></g>
<g data-from="5" data-to="3"><path d="M 1305.8333333333335 662.8000000000001 H 837.1666666666667" fill="none" stroke="#253443" stroke-width="1.6" stroke-dasharray="7 5" marker-end="url(#arrow)"/><text x="1071.5" y="648.2" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="1071.5" dy="0">Return correlated evidence</tspan></text></g>
<g data-from="3" data-to="2"><path d="M 837.1666666666667 760.0000000000001 H 602.8333333333334" fill="none" stroke="#253443" stroke-width="1.6" stroke-dasharray="7 5" marker-end="url(#arrow)"/><text x="720" y="716.8000000000001" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="720" dy="0">Action-required</tspan><tspan x="720" dy="28.6">webhook</tspan></text></g>
<g data-from="2" data-to="3"><path d="M 602.8333333333334 857.2000000000002 H 837.1666666666667" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="720" y="814.0000000000001" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="720" dy="0">Fetch pending tool</tspan><tspan x="720" dy="28.6">call</tspan></text></g>
<g data-from="2" data-to="1"><path d="M 602.8333333333334 954.4000000000002 H 368.5" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="485.6666666666667" y="911.2000000000002" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="485.6666666666667" dy="0">Post approval</tspan><tspan x="485.6666666666667" dy="28.6">buttons</tspan></text></g>
<g data-from="1" data-to="2"><path d="M 368.5 1023.0000000000002 H 602.8333333333334" fill="none" stroke="#253443" stroke-width="1.6" stroke-dasharray="7 5" marker-end="url(#arrow)"/><text x="485.6666666666667" y="1008.4000000000002" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="485.6666666666667" dy="0">Approve or reject</tspan></text></g>
<g data-from="2" data-to="3"><path d="M 602.8333333333334 1091.6000000000001 H 837.1666666666667" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="720" y="1077.0000000000002" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="720" dy="0">Submit decision</tspan></text></g>
<g data-from="3" data-to="1"><path d="M 837.1666666666667 1160.2 H 368.5" fill="none" stroke="#253443" stroke-width="1.6" stroke-dasharray="7 5" marker-end="url(#arrow)"/><text x="602.8333333333334" y="1145.6000000000001" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="602.8333333333334" dy="0">Explain next steps</tspan></text></g>
<g data-from="1" data-to="2"><path d="M 368.5 1228.8 H 602.8333333333334" fill="none" stroke="#253443" stroke-width="1.6" stroke-dasharray="7 5" marker-end="url(#arrow)"/><text x="485.6666666666667" y="1214.2" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="485.6666666666667" dy="0">Ask a follow-up</tspan></text></g>
<g data-from="2" data-to="3"><path d="M 602.8333333333334 1326 H 837.1666666666667" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="720" y="1282.8" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="720" dy="0">Continue same</tspan><tspan x="720" dy="28.6">session</tspan></text></g>
<g data-from="2" data-to="2"><path d="M 602.8333333333334 1423.2 H 666.8333333333334 V 1455.2 H 602.8333333333334" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="602.8333333333334" y="1380" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="602.8333333333334" dy="0">Save incident</tspan><tspan x="602.8333333333334" dy="28.6">memory</tspan></text></g>
<g data-from="2" data-to="3"><path d="M 602.8333333333334 1527.8 H 837.1666666666667" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="720" y="1513.2" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="720" dy="0">Delete session</tspan></text></g>
<g data-from="2" data-to="4"><path d="M 602.8333333333334 1596.3999999999999 H 1071.5" fill="none" stroke="#253443" stroke-width="1.6" marker-end="url(#arrow)"/><text x="837.1666666666667" y="1581.8" text-anchor="middle" font-size="22" font-weight="400" fill="#162231"><tspan x="837.1666666666667" dy="0">Remove sandbox</tspan></text></g>
<text x="24" y="1681.3999999999999" text-anchor="start" font-size="17" font-weight="400" fill="#4D5B6A"><tspan x="24" dy="0">Approval records a decision, not a rollback. Incident memory is application-owned.</tspan></text>
</g></svg>