Coding After Coders: The End of Computer Programming as We Know It
Epic piece on AI-assisted development by Clive Thompson for the New York Times Magazine, who spoke to more than 70 software developers from companies like Google, Amazon, Microsoft, Apple, plus other individuals including Anil Dash, Thomas Ptacek, Steve Yegge, and myself.I think the piece accurately and clearly captures what's going on in our industry right now in terms appropriate for a wider audience.
I talked to Clive a few weeks ago. Here's the quote from me that made it into the piece.
Given A.I.’s penchant to hallucinate, it might seem reckless to let agents push code out into the real world. But software developers point out that coding has a unique quality: They can tether their A.I.s to reality, because they can demand the agents test the code to see if it runs correctly. “I feel like programmers have it easy,” says Simon Willison, a tech entrepreneur and an influential blogger about how to code using A.I. “If you’re a lawyer, you’re screwed, right?” There’s no way to automatically check a legal brief written by A.I. for hallucinations — other than face total humiliation in court.
The piece does raise the question of what this means for the future of our chosen line of work, but the general attitude from the developers interviewed was optimistic - there's even a mention of the possibility that the Jevons paradox might increase demand overall.
One critical voice came from an Apple engineer:
A few programmers did say that they lamented the demise of hand-crafting their work. “I believe that it can be fun and fulfilling and engaging, and having the computer do it for you strips you of that,” one Apple engineer told me. (He asked to remain unnamed so he wouldn’t get in trouble for criticizing Apple’s embrace of A.I.)
That request to remain anonymous is a sharp reminder that corporate dynamics may be suppressing an unknown number of voices on this topic.
Tags: new-york-times, careers, ai, generative-ai, llms, ai-assisted-programming, press-quotes, deep-blue
Agent harness is the layer where model reasoning connects to real execution: shell and filesystem access, approval flows, and context management across long-running sessions. With Agent Framework, these patterns can now be built consistently in both Python and .NET.
In this post, we’ll look at three practical building blocks for production agents:
Many agent experiences need to do more than generate text. They need to inspect files, run commands, and work with the surrounding environment in a controlled way. Agent Framework makes it possible to model those capabilities explicitly, with approval patterns where needed.
The following examples show compact harness patterns in both Python and .NET.
Python: Local shell with approvals
import asyncio
import subprocess
from typing import Any
from agent_framework import Agent, Message, tool
from agent_framework.openai import OpenAIResponsesClient
@tool(approval_mode="always_require")
def run_bash(command: str) -> str:
"""Execute a shell command locally and return stdout, stderr, and exit code."""
result = subprocess.run(
command,
shell=True,
capture_output=True,
text=True,
timeout=30,
)
parts: list[str] = []
if result.stdout:
parts.append(result.stdout)
if result.stderr:
parts.append(f"stderr: {result.stderr}")
parts.append(f"exit_code: {result.returncode}")
return "\n".join(parts)
async def run_with_approvals(query: str, agent: Agent) -> Any:
current_input: str | list[Any] = query
while True:
result = await agent.run(current_input)
if not result.user_input_requests:
return result
next_input: list[Any] = [query]
for request in result.user_input_requests:
print(f"Shell request: {request.function_call.name}")
print(f"Arguments: {request.function_call.arguments}")
approved = (await asyncio.to_thread(input, "Approve command? (y/n): ")).strip().lower() == "y"
next_input.append(Message("assistant", [request]))
next_input.append(Message("user", [request.to_function_approval_response(approved)]))
if not approved:
return "Shell command execution was rejected by user."
current_input = next_input
async def main() -> None:
client = OpenAIResponsesClient(
model_id="<responses-model-id>",
api_key="<your-openai-api-key>",
)
local_shell_tool = client.get_shell_tool(func=run_bash)
agent = Agent(
client=client,
instructions="You are a helpful assistant that can run shell commands.",
tools=[local_shell_tool],
)
result = await run_with_approvals(
"Use run_bash to execute `python --version` and show only stdout.",
agent,
)
print(result)
if __name__ == "__main__":
asyncio.run(main())
This pattern keeps execution on the host machine while giving the application a clear approval checkpoint before the command runs.
Security note: For local shell execution, we recommend running this logic in an isolated environment and keeping explicit approval in place before commands are allowed to run.
Python: Hosted shell in a managed environment
import asyncio
from agent_framework import Agent
from agent_framework.openai import OpenAIResponsesClient
async def main() -> None:
client = OpenAIResponsesClient(
model_id="<responses-model-id>",
api_key="<your-openai-api-key>",
)
shell_tool = client.get_shell_tool()
agent = Agent(
client=client,
instructions="You are a helpful assistant that can execute shell commands.",
tools=shell_tool,
)
result = await agent.run("Use a shell command to show the current date and time")
print(result)
for message in result.messages:
shell_calls = [c for c in message.contents if c.type == "shell_tool_call"]
shell_results = [c for c in message.contents if c.type == "shell_tool_result"]
if shell_calls:
print(f"Shell commands: {shell_calls[0].commands}")
if shell_results and shell_results[0].outputs:
for output in shell_results[0].outputs:
if output.stdout:
print(f"Stdout: {output.stdout}")
if output.stderr:
print(f"Stderr: {output.stderr}")
if output.exit_code is not None:
print(f"Exit code: {output.exit_code}")
if __name__ == "__main__":
asyncio.run(main())
Hosted shell is useful when you want the agent to execute commands in a provider-managed environment rather than directly on the local machine.
.NET: Local shell with approvals
using System.ComponentModel;
using System.Diagnostics;
using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;
using OpenAI;
var apiKey = "<your-openai-api-key>";
var model = "<responses-model-id>";
[Description("Execute a shell command locally and return stdout, stderr and exit code.")]
static string RunBash([Description("Bash command to execute.")] string command)
{
using Process process = new()
{
StartInfo = new ProcessStartInfo
{
FileName = "/bin/bash",
ArgumentList = { "-lc", command },
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
}
};
process.Start();
process.WaitForExit(30_000);
string stdout = process.StandardOutput.ReadToEnd();
string stderr = process.StandardError.ReadToEnd();
return $"stdout:\n{stdout}\nstderr:\n{stderr}\nexit_code:{process.ExitCode}";
}
IChatClient chatClient = new OpenAIClient(apiKey)
.GetResponsesClient(model)
.AsIChatClient();
AIAgent agent = chatClient.AsAIAgent(
name: "LocalShellAgent",
instructions: "Use tools when needed. Avoid destructive commands.",
tools: [new ApprovalRequiredAIFunction(AIFunctionFactory.Create(RunBash, name: "run_bash"))]);
AgentSession session = await agent.CreateSessionAsync();
AgentResponse response = await agent.RunAsync("Use run_bash to execute `dotnet --version` and return only stdout.", session);
List<FunctionApprovalRequestContent> approvalRequests = response.Messages
.SelectMany(m => m.Contents)
.OfType<FunctionApprovalRequestContent>()
.ToList();
while (approvalRequests.Count > 0)
{
List<ChatMessage> approvals = approvalRequests
.Select(request => new ChatMessage(ChatRole.User, [request.CreateResponse(approved: true)]))
.ToList();
response = await agent.RunAsync(approvals, session);
approvalRequests = response.Messages
.SelectMany(m => m.Contents)
.OfType<FunctionApprovalRequestContent>()
.ToList();
}
Console.WriteLine(response);
Like the Python version, this approach combines local execution with an explicit approval flow so the application stays in control of what actually runs.
Security note: For local shell execution, we recommend running this logic in an isolated environment and keeping explicit approval in place before commands are allowed to run.
.NET: Hosted shell with protocol-level configuration
using Microsoft.Agents.AI;
using Microsoft.Extensions.AI;
using OpenAI;
using OpenAI.Responses;
var apiKey = "<your-openai-api-key>";
var model = "<responses-model-id>";
IChatClient chatClient = new OpenAIClient(apiKey)
.GetResponsesClient(model)
.AsIChatClient();
CreateResponseOptions hostedShellOptions = new();
hostedShellOptions.Patch.Set(
"$.tools"u8,
BinaryData.FromObjectAsJson(new object[]
{
new
{
type = "shell",
environment = new
{
type = "container_auto"
}
}
}));
AIAgent agent = chatClient
.AsBuilder()
.BuildAIAgent(new ChatClientAgentOptions
{
Name = "HostedShellAgent",
UseProvidedChatClientAsIs = true,
ChatOptions = new ChatOptions
{
Instructions = "Use shell commands to answer precisely.",
RawRepresentationFactory = _ => hostedShellOptions
}
});
AgentResponse response = await agent.RunAsync("Use a shell command to print UTC date/time. Return only command output.");
Console.WriteLine(response);
This makes it possible to target a managed shell environment from .NET today while keeping the rest of the agent flow in the standard Agent Framework programming model.
Long-running agent sessions accumulate chat history that can exceed a model’s context window. The Agent Framework includes a built-in compaction system that automatically manages conversation history before each model call — keeping agents within their token budget without losing important context (Docs).
Python: In-run compaction on the agent
import asyncio
from agent_framework import Agent, InMemoryHistoryProvider, SlidingWindowStrategy, tool
from agent_framework.openai import OpenAIChatClient
@tool(approval_mode="never_require")
def get_weather(city: str) -> str:
weather_data = {
"London": "cloudy, 12°C",
"Paris": "sunny, 18°C",
"Tokyo": "rainy, 22°C",
}
return weather_data.get(city, f"No data for {city}")
async def main() -> None:
client = OpenAIChatClient(
model_id="<chat-model-id>",
api_key="<your-openai-api-key>",
)
agent = Agent(
client=client,
instructions="You are a helpful weather assistant.",
tools=[get_weather],
context_providers=[InMemoryHistoryProvider()],
compaction_strategy=SlidingWindowStrategy(keep_last_groups=3),
)
session = agent.create_session()
for query in [
"What is the weather in London?",
"How about Paris?",
"And Tokyo?",
"Which city is the warmest?",
]:
result = await agent.run(query, session=session)
print(result.text)
if __name__ == "__main__":
asyncio.run(main())
This example keeps the most recent conversational context intact while trimming older tool-heavy exchanges that no longer need to be replayed in full.
.NET: Compaction pipeline with multiple strategies
using System.ComponentModel;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Compaction;
using Microsoft.Extensions.AI;
using OpenAI;
var apiKey = "<your-openai-api-key>";
var model = "<chat-model-id>";
[Description("Look up the current price of a product by name.")]
static string LookupPrice([Description("The product to look up.")] string productName) =>
productName.ToUpperInvariant() switch
{
"LAPTOP" => "The laptop costs $999.99.",
"KEYBOARD" => "The keyboard costs $79.99.",
"MOUSE" => "The mouse costs $29.99.",
_ => $"No data for {productName}."
};
IChatClient chatClient = new OpenAIClient(apiKey)
.GetChatClient(model)
.AsIChatClient();
PipelineCompactionStrategy compactionPipeline = new(
new ToolResultCompactionStrategy(CompactionTriggers.MessagesExceed(7)),
new SlidingWindowCompactionStrategy(CompactionTriggers.TurnsExceed(4)),
new TruncationCompactionStrategy(CompactionTriggers.GroupsExceed(12)));
AIAgent agent = chatClient
.AsBuilder()
.UseAIContextProviders(new CompactionProvider(compactionPipeline))
.BuildAIAgent(new ChatClientAgentOptions
{
Name = "ShoppingAssistant",
ChatOptions = new ChatOptions
{
Instructions = "You are a concise shopping assistant.",
Tools = [AIFunctionFactory.Create(LookupPrice)]
},
ChatHistoryProvider = new InMemoryChatHistoryProvider()
});
AgentSession session = await agent.CreateSessionAsync();
string[] prompts =
[
"What's the price of a laptop?",
"How about a keyboard?",
"And a mouse?",
"Which is cheapest?",
"What was the first product I asked about?"
];
foreach (string prompt in prompts)
{
Console.WriteLine($"User: {prompt}");
AgentResponse response = await agent.RunAsync(prompt, session);
Console.WriteLine($"Agent: {response}\\n");
if (session.TryGetInMemoryChatHistory(out var history))
{
Console.WriteLine($"[Stored message count: {history.Count}]\\n");
}
}
By combining multiple compaction strategies, you can keep sessions responsive and cost-aware without giving up continuity.
These patterns make Agent Framework a stronger foundation for real-world agent systems:
Whether you are building an assistant that can inspect a project workspace or a multi-step workflow that needs durable context over time, these capabilities help close the gap between model reasoning and practical execution.
For more information, check out our documentation and examples on GitHub, and install the latest packages from NuGet (.NET) or PyPI (Python).
The post Agent Harness in Agent Framework appeared first on Microsoft Agent Framework.
Apps must use the official APIs, see below.
Windows enforces:
Only one process can open the clipboard at a time.
A process must own the clipboard to modify it.
Apps cannot read the clipboard without requesting access.
When you copy something, Windows doesn’t just store the raw bytes. It stores one or more representations of the data, each tagged with a format ID.
A clipboard format tells Windows and applications:
what kind of data is stored
how to interpret it
how to convert it if needed
This is why you can copy text from Word and paste it as plain text, rich text, HTML, or even an image depending on the target app.
Clipboard formats commonly used (CF_TEXT, CF_UNICODETEXT, CF_HDROP, custom formats) are stored as handles to memory blocks.
| Constant/value | Description |
|---|---|
|
A handle to a bitmap (HBITMAP). |
|
A memory object containing a BITMAPINFO structure followed by the bitmap bits. |
|
A memory object containing a BITMAPV5HEADER structure followed by the bitmap color space information and the bitmap bits. |
|
Software Arts' Data Interchange Format. |
|
Bitmap display format associated with a private format. The hMem parameter must be a handle to data that can be displayed in bitmap format in lieu of the privately formatted data. |
|
Enhanced metafile display format associated with a private format. The hMem parameter must be a handle to data that can be displayed in enhanced metafile format in lieu of the privately formatted data. |
|
Metafile-picture display format associated with a private format. The hMem parameter must be a handle to data that can be displayed in metafile-picture format in lieu of the privately formatted data. |
|
Text display format associated with a private format. The hMem parameter must be a handle to data that can be displayed in text format in lieu of the privately formatted data. |
|
A handle to an enhanced metafile (HENHMETAFILE). |
|
Start of a range of integer values for application-defined GDI object clipboard formats. The end of the range is CF_GDIOBJLAST. Handles associated with clipboard formats in this range are not automatically deleted using the GlobalFree function when the clipboard is emptied. Also, when using values in this range, the hMem parameter is not a handle to a GDI object, but is a handle allocated by the GlobalAlloc function with the GMEM_MOVEABLE flag. |
|
See CF_GDIOBJFIRST. |
|
A handle to type HDROP that identifies a list of files. An application can retrieve information about the files by passing the handle to the DragQueryFile function. |
|
The data is a handle to the locale
identifier associated with text in the clipboard. When you close the
clipboard, if it contains CF_TEXT data but no CF_LOCALE data, the system automatically sets the CF_LOCALE format to the current input language. You can use the CF_LOCALE format to associate a different locale with the clipboard text. An application that pastes text from the clipboard can retrieve this format to determine which character set was used to generate the text. Note that the clipboard does not support plain text in multiple character sets. To achieve this, use a formatted text data type such as RTF instead. The system uses the code page associated with CF_LOCALE to implicitly convert from CF_TEXT to CF_UNICODETEXT. Therefore, the correct code page table is used for the conversion. |
|
Handle to a metafile picture format as defined by the METAFILEPICT structure. When passing a CF_METAFILEPICT handle by means of DDE, the application responsible for deleting hMem should also free the metafile referred to by the CF_METAFILEPICT handle. |
|
Text format containing characters in the OEM character set. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. |
|
Owner-display format. The clipboard owner must display and update the clipboard viewer window, and receive the WM_ASKCBFORMATNAME, WM_HSCROLLCLIPBOARD, WM_PAINTCLIPBOARD, WM_SIZECLIPBOARD, and WM_VSCROLLCLIPBOARD messages. The hMem parameter must be NULL. |
|
Handle to a color palette. Whenever an
application places data in the clipboard that depends on or assumes a
color palette, it should place the palette on the clipboard as well. If the clipboard contains data in the CF_PALETTE (logical color palette) format, the application should use the SelectPalette and RealizePalette functions to realize (compare) any other data in the clipboard against that logical palette. When displaying clipboard data, the clipboard always uses as its current palette any object on the clipboard that is in the CF_PALETTE format. |
|
Data for the pen extensions to the Microsoft Windows for Pen Computing. |
|
Start of a range of integer values for private clipboard formats. The range ends with CF_PRIVATELAST. Handles associated with private clipboard formats are not freed automatically; the clipboard owner must free such handles, typically in response to the WM_DESTROYCLIPBOARD message. |
|
See CF_PRIVATEFIRST. |
|
Represents audio data more complex than can be represented in a CF_WAVE standard wave format. |
|
Microsoft Symbolic Link (SYLK) format. |
|
Text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. Use this format for ANSI text. |
|
Tagged-image file format. |
|
Unicode text format. Each line ends with a carriage return/linefeed (CR-LF) combination. A null character signals the end of the data. |
|
Represents audio data in one of the standard wave formats, such as 11 kHz or 22 kHz PCM. |
TL;DR; No - AI won’t kill open source, but it will reshape it. Small, single-purpose packages (micro open source) are likely to languish as AI agents write trivial utility code on the fly. But major frameworks, databases, and runtimes like Django, Postgres, and Python itself aren’t going anywhere - AI agents actually prefer reaching for established building blocks over reinventing them. The key is staying in the architect’s seat.
AI will replace the trivial, leave the foundational, and force us to rethink everything in between:
uv pip install over reinventing DjangoI sat down with Paul Everitt to debate this question, and it turns out the answer is way more nuanced than a simple yes or no.
Watch the full conversation on YouTube →
Paul kicked things off with a great framing. Think of building an app like a 100-meter soccer field. A framework like Flask or Django gets you 95 meters down the field. You and your AI agent only need to handle the last 5 meters – the part that’s unique to your app.
Why would an agent rebuild those 95 meters from scratch when it can just uv pip install the framework and focus on the hard part? Software is a liability, not an asset, and owning all of that code means owning all of those future bugs.
But there’s a counterargument: if you only need 10% of a framework, you’re still dragging in the other 90% – attack surface, security issues, maintenance burden. Maybe you’re better off owning a small thing than renting a large one?
I think the real casualty here is micro open source – those tiny packages that wrap a single function or a handful of utility classes.
Evidence? Tailwind usage: It’s up 600% in the last 18 months, largely because AI loves reaching for it. But the revenue story for Tailwind is heading in the opposite direction. AI can easily write the 47 utility classes you actually need instead of pulling in the whole framework.
What should go? Micro-packages: There’s the left-pad cautionary tale. A single trivial function as a standalone package took down huge swaths of the JavaScript ecosystem when its maintainer pulled it. AI should absolutely be writing those two functions for us instead of importing a package for them.
Here’s what I don’t see happening: an AI saying “let me rebuild Postgres for you” or “give me an hour, I’ll recreate Django from scratch.” Even if it could, why would it? The agent’s goal is to solve your problem well and quickly. uv pip install django is faster and more reliable than conjuring up a bespoke web framework.
At the macro level, frameworks, databases, runtimes, open source is safe.
Paul raised an important point: what happens when AI pricing subsidies end and costs go up 5x? My take is that hardware costs are dropping even faster.
NVIDIA’s latest inference hardware is roughly 10x cheaper per token than two years ago:
“NVIDIA GB200 NVL72 with extreme hardware and software codesign delivers more than 10x more tokens per watt, resulting in one-tenth the cost per token.”
And the Apple Silicon trajectory means serious local model capability is coming to everyone’s laptop. The bubble isn’t as extreme as people imagine.
We also dug into the “just send it” overnight agent workflow – and neither of us is a fan. Working in small, reviewable chunks is the way. Think spec-driven development, not “agents devour this, I’ll see you in the morning.”
Our job was never to type characters. It’s to ship quality software. If you apply engineering discipline – specs, tests, architecture decisions – then AI-assisted code is absolutely something you can put your name on. Paul shared his crisis of confidence the first time he hit Enter on twine upload for an AI-assisted package. I think a lot of developers can relate to that moment. But the question comes down to: did you ship something well-built that serves a purpose? If yes, the tooling you used to get there matters a lot less than you think.
Here’s the workflow that actually works:
Micro open source is probably toast. The big building blocks aren’t going anywhere. But the key is to stay in the architect’s seat – choose your frameworks, specify your stack, review the output. Be the architect handing specs to the contractor, and don’t give that role away to the AI.
There’s a lot more in the full conversation including anti-AI vigilante groups shaming people for publishing agent-assisted packages, the open source gift economy, and why none of us really know where this is all heading yet.