<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>AI | Qingyuan Zhao</title>
    <link>https://www.statslab.cam.ac.uk/~qz280/tag/ai/</link>
      <atom:link href="https://www.statslab.cam.ac.uk/~qz280/tag/ai/index.xml" rel="self" type="application/rss+xml" />
    <description>AI</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>2026</copyright><lastBuildDate>Wed, 03 Jun 2026 09:40:00 +0100</lastBuildDate>
    <image>
      <url>https://www.statslab.cam.ac.uk/~qz280/images/icon_hu6351ee64df48d2892d6749f985b342fb_222017_512x512_fill_lanczos_center_3.png</url>
      <title>AI</title>
      <link>https://www.statslab.cam.ac.uk/~qz280/tag/ai/</link>
    </image>
    
    <item>
      <title>An introduction to AI agents</title>
      <link>https://www.statslab.cam.ac.uk/~qz280/post/ai-agent-intro/</link>
      <pubDate>Wed, 03 Jun 2026 09:40:00 +0100</pubDate>
      <guid>https://www.statslab.cam.ac.uk/~qz280/post/ai-agent-intro/</guid>
      <description>&lt;h2 id=&#34;what-are-ai-agents&#34;&gt;What are AI agents?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Wikipedia definition: AI agents are a class of intelligent agents
that can &lt;strong&gt;pursue goals, use tools, and take actions&lt;/strong&gt; with &lt;strong&gt;varying
degrees of autonomy&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;My definition in 2026: AI agents are the interface between human and
foundation models.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;how-are-ai-agents-different-from-using-web-chats&#34;&gt;How are AI agents different from using web chats?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Ability to use local &lt;strong&gt;tools&lt;/strong&gt; e.g., &lt;code&gt;read&lt;/code&gt;, &lt;code&gt;edit&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;bash&lt;/code&gt; to
edit your your local files or run &lt;code&gt;bash Rscript agent_written_r_script.R&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Delegate specific projects to specialist &lt;strong&gt;subagents&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;More consistent prompts via &lt;strong&gt;skills&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;should-i-use-ai-agents&#34;&gt;Should I use AI agents?&lt;/h2&gt;
&lt;p&gt;Compared to just using chat-boxes, using AI agents raise additional
risks:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Security&lt;/dt&gt;
&lt;dd&gt;AI agents might change your local files without
permission.&lt;/dd&gt;
&lt;dt&gt;Privacy&lt;/dt&gt;
&lt;dd&gt;AI agents will give local files to foundation models, and
providers of those models might use your data for training or other
purposes.&lt;/dd&gt;
&lt;dt&gt;Loss of human agency&lt;/dt&gt;
&lt;dd&gt;It is always tempting to give AI agents more
autonomy so they do their tasks better.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;managing-the-risks&#34;&gt;Managing the risks&lt;/h2&gt;
&lt;h3 id=&#34;security&#34;&gt;Security&lt;/h3&gt;
&lt;p&gt;Manage the permission for different AI agents very carefully. Never
allow AI agents to edit their configuration files.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;This is not always possible.&lt;/strong&gt; For example, even if the agent is not
allowed to use the &lt;code&gt;edit&lt;/code&gt; tool, but if you allow it to use &lt;code&gt;python&lt;/code&gt;
to test your conjecture, a malicious agent can still edit your local
files through &lt;code&gt;python&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;privacy&#34;&gt;Privacy&lt;/h3&gt;
&lt;p&gt;This can be addressed by deploying open-weights models on a trusted
server.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open-weights models (e.g. GLM-5.1, DeepSeek V4 Pro) are getting
quite good but still behind closed models for extremely demanding
tasks (e.g. GPT-5.5 Pro, Opus 4.8).&lt;/li&gt;
&lt;li&gt;The ability to deploy local models is limited by the local computing
environment (in particular, the available GPUs).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;loss-of-human-agency&#34;&gt;Loss of human agency&lt;/h3&gt;
&lt;p&gt;We need to think about (at least the current) AI agents as an
&lt;strong&gt;human-LLM interface&lt;/strong&gt; (a form of human-computer interaction) instead
of another human being or super-intelligence.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For this reason, I much prefer open-source agents (e.g. OpenCode)
over proprietary agents (Claude Code), so I fully own my interface with
LLMs.&lt;/li&gt;
&lt;li&gt;A good general principle to follow: &lt;strong&gt;spend at least 80% of your time
on planning and at most 20% on execution&lt;/strong&gt; (just like how you spend
80% of your time understanding and solving a mathematical problem
and 20% of your time writing down your solution).&lt;/li&gt;
&lt;li&gt;An event better principle (which I haven&amp;rsquo;t been able to follow): &lt;strong&gt;do
not share any file that is not hand-written by you to anyone else&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;opencode-how-to-get-started&#34;&gt;OpenCode: How to get started&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;https://opencode.ai/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;https://opencode.ai/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;You can download and install the agent easily &amp;mdash; if there are
technical issues, ask your web-based chatbots.&lt;/li&gt;
&lt;li&gt;The built-in &lt;code&gt;Plan&lt;/code&gt; agent cannot edit any files without your
permission. So it&amp;rsquo;s relatively safe to explore with it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;recommended-configuration&#34;&gt;Recommended configuration&lt;/h3&gt;
&lt;p&gt;Copy this to &lt;code&gt;~/.config/opencode/opencode.json&lt;/code&gt;. This implements my
risk management recommendations above.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;{
  &amp;quot;$schema&amp;quot;: &amp;quot;https://opencode.ai/config.json&amp;quot;,
  &amp;quot;default_agent&amp;quot;: &amp;quot;plan&amp;quot;,
  &amp;quot;permission&amp;quot;: {
    &amp;quot;external_directory&amp;quot;: &amp;quot;ask&amp;quot;,
    &amp;quot;edit&amp;quot;: {
      &amp;quot;/Users/qyzhao/.config/opencode/opencode.json&amp;quot;: &amp;quot;deny&amp;quot;,
      &amp;quot;/Users/qyzhao/.config/opencode/agents/*.md&amp;quot;: &amp;quot;deny&amp;quot;
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I am spending a lot of time on developing an agent (human-LLM
interface) for scientific researchers based on the philosophy of

&lt;a href=&#34;https://en.wikipedia.org/wiki/Charles_Sanders_Peirce&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;Charles Sanders Peirce&lt;/a&gt;. Watch this space!&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
