<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Leyla Mousavi on Medium]]></title>
        <description><![CDATA[Stories by Leyla Mousavi on Medium]]></description>
        <link>https://medium.com/@bdcktqmp?source=rss-b917d4a1a759------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9RUAu9ScTetqZyLWqmZtOQ@2x.jpeg</url>
            <title>Stories by Leyla Mousavi on Medium</title>
            <link>https://medium.com/@bdcktqmp?source=rss-b917d4a1a759------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:32:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bdcktqmp/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When APIs Disappear, The Rise of Model Context Protocols]]></title>
            <link>https://medium.com/@bdcktqmp/when-apis-disappear-the-rise-of-model-context-protocols-e1471583d5e8?source=rss-b917d4a1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1471583d5e8</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mcp-protocol]]></category>
            <category><![CDATA[software-architect]]></category>
            <dc:creator><![CDATA[Leyla Mousavi]]></dc:creator>
            <pubDate>Tue, 12 Aug 2025 19:45:36 GMT</pubDate>
            <atom:updated>2025-08-12T19:45:36.492Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>From API-First to MCP-First</strong></p><h3>The Future Without Endpoints</h3><p>Imagine integrating with another system without ever opening an API documentation page or debugging JSON parsing errors. Instead, your application simply understands what the other system can do, requests the needed action, and receives the result, all negotiated dynamically in real time.</p><p>That is no longer science fiction. With the emergence of the Model Context Protocol (MCP) and the rise of intelligent agents, we may be witnessing the start of a shift that will make traditional APIs fade into the background or, in many cases, be replaced entirely.</p><p>For decades, API-first design has been the foundation of digital integration, connecting platforms, microservices, and ecosystems through well-defined endpoints. But with the rise of MCP and intelligent agents, we are entering a new era where systems negotiate and execute capabilities dynamically, without relying on rigid contracts. This shift from API-first to MCP-first moves governance, security, and reliability from static endpoints to real-time capability definitions, enabling faster integration, adaptive interfaces, and a new “capability economy.”</p><h3>The World We Live in Today: APIs Everywhere</h3><p>For decades, APIs have been the lifeblood of digital integration. REST, GraphQL, and gRPC dominate the landscape, connecting SaaS platforms, microservices, and devices. They are indispensable, but they come at a cost.</p><p>Documentation requires constant updates to keep pace with features. Versioning issues lead to breaking changes that cascade through dependent systems. Rigid schemas mean even small adjustments can force extensive rework. Integration overhead consumes valuable development time that could be spent delivering new capabilities.</p><p>APIs brought order to integration chaos, but they are showing their limits in a world increasingly driven by real-time AI orchestration.</p><h3>Enter MCP: Model Context Protocol</h3><p>The Model Context Protocol offers a new way for applications, particularly those powered by Large Language Models, to discover and use capabilities dynamically.</p><p>MCP is an open protocol that defines how a client, such as an AI agent or application, can request and consume capabilities from a server. It includes a standard for describing what the server can do, how to invoke those capabilities, and how to handle results and errors. It is not just an API wrapper or a chat extension it is a capability negotiation layer that replaces the need for fixed endpoint contracts.</p><p><strong>Example: MCP Capability Negotiation in a Smart Building</strong></p><p>The AI-powered building assistant asks the MCP server for its available capabilities. The server responds with a catalog, such as:</p><ul><li>Adjust HVAC for a given zone. adjust_hvac_temperature(zone_id: string, temperature: number)</li><li>Retrieve energy metrics. get_energy_consumption(time_range: enum[last_hour, today, this_week])</li></ul><p>The client chooses adjust_hvac_temperature for zone_id = “EastWing-3F” with temperature = 22. The server verifies permissions, applies the change, and returns confirmation. An append-only audit log records the capability, parameters, caller identity, timestamp, and outcome. This flow illustrates how MCP moves integration from endpoint calls to real-time capability negotiation and execution.</p><h3>Why APIs Might “Go Away”</h3><p>APIs will not vanish overnight. The network calls, schemas, and authentication mechanisms will continue to exist beneath the surface. What will change is the developer experience.</p><p>Rather than calling fixed endpoints such as /v1/getUser, developers will request actions like “retrieve user profile” and let the protocol determine how to fulfill the request. Integration logic will be negotiated in real time instead of relying on static contracts. If a capability changes, the model can adapt instantly, avoiding downtime.</p><p>It is similar to how we no longer think about TCP/IP packets when we browse the web. The plumbing remains, but the interface is higher-level and more intuitive.</p><h3>APIs in the MCP Era: Transitional Gateways</h3><p>Over the next decade, APIs may shift to an infrastructure role rather than serving as the primary integration interface. MCP layers can sit on top of APIs, translating capability requests into API calls. In some scenarios, MCP may replace the API layer entirely, becoming the direct integration contract between systems. API gateways can evolve into capability gateways, delivering the same governance functions they provide today for APIs such as security, monetization, caching, and policy enforcement, but adapted for MCP.</p><p>The diagram below shows the MCP gateway’s role in translating capability requests into backend actions, applying security and policy controls, and ensuring reliable execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8ijuaXTF_l_RYvf9" /></figure><h3>Risks and Challenges</h3><p>Shifting from traditional APIs to MCP-driven capability negotiation introduces new technical, governance, and operational risks that must be addressed early.</p><p>Security complexity will increase as authentication and authorization move from static endpoint rules to dynamic, context-aware capability scopes. Preventing prompt or tool injection, enforcing tenant isolation, and respecting data residency rules will require new patterns in policy enforcement, likely embedded in capability gateways. In an MCP-driven world, these gateways will also need to handle security at the capability level. Identities may still be issued through OAuth2, OIDC, or mTLS, but authorization will be defined by capability scopes rather than static endpoint paths. Policies will need to support dynamic least privilege, granting access to capabilities based on real-time context and user or agent roles. This includes protection against prompt or tool injection, sandboxing execution, and ensuring sensitive data boundaries, such as PII and regulated data, are respected.</p><p>Governance and auditability become harder when capabilities are negotiated in real time. Without robust, append-only audit trails that capture who requested a capability, under what context, and why, organizations risk compliance failures in regulated industries.</p><p>Reliability and determinism present new challenges. Dynamic negotiation adds latency, and repeated planning can introduce variability in execution. Gateways will need to cache hot-path capability definitions, enforce idempotency, handle retries gracefully, and apply circuit breaking when upstream systems fail.</p><p>Versioning without endpoints means no /v1 or /v2 markers to signal breaking changes. Instead, organizations will have to manage capability contracts, negotiate backward-compatible definitions, and support phased deprecation without disrupting dependent agents or applications.</p><p>Standardization risk is real. If MCP-like protocols fragment across vendors without interoperability standards, developers could face capability silos as problematic as API fragmentation today.</p><p>Operational complexity will initially rise. Teams must integrate new observability stacks to trace capability calls, measure latency and error budgets, and monitor for unusual request patterns. Without this, failures may be opaque and difficult to debug.</p><p>Performance trade-offs are inevitable. While MCP promises faster integration at the design level, real-time negotiation can be slower than calling a pre-optimized API path. Success will depend on careful use of caching, hybrid strategies that use MCP for orchestration and APIs for high-QPS paths, and execution plan reuse.</p><h3>Predictions: The Next Decade</h3><p>In the next one to three years, MCP adoption is likely to begin in AI-heavy platforms and agent orchestration frameworks, especially for plug-and-play integrations in LLM ecosystems.</p><p>In three to six years, major SaaS platforms may expose MCP alongside REST and GraphQL, with API gateways offering MCP-based governance. Enterprise integration teams may begin shifting their focus from API management to capability orchestration.</p><p>In six to ten years, most external integrations could occur through negotiated context protocols. In many cases, MCP might replace the API layer entirely, with APIs remaining as internal plumbing.</p><h3>Why This Matters</h3><p>If MCP and similar protocols succeed, integration will be fundamentally different. Development velocity will increase as systems can be connected in hours instead of weeks. AI agents will navigate and use services without human-written glue code. The API economy will evolve into a capability economy, where value lies in what a system can do, not how it is called.</p><h3>Closing Thought</h3><p>APIs will not die, but they will stop being the star of the show. Much like TCP/IP faded from our awareness, endpoint-driven integration will give way to context-driven, self-describing protocols.</p><p>If MCP delivers on its promise, we may soon live in a world where integrating two systems feels less like coding an interface and more like introducing two colleagues who instantly understand how to work together. In some cases, MCP may quietly replace the API layer entirely, with governance handled by the same gateways we depend on today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1471583d5e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building the Moral Core of AI Systems]]></title>
            <link>https://medium.com/@bdcktqmp/building-the-moral-core-of-ai-systems-3030b326bbfd?source=rss-b917d4a1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/3030b326bbfd</guid>
            <category><![CDATA[ai-model-training]]></category>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[systems-thinking]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Leyla Mousavi]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 14:55:18 GMT</pubDate>
            <atom:updated>2025-08-05T14:55:18.333Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Designing Intelligence That Thinks Morally Before It Acts: AI Moral Operating System</em></strong></p><p>I am not sure by the time you are reading this article what the latest news about AI will be, as this field moves incredibly fast. But I am certain you’ve been exposed to the flood of talking points, headlines, and polarized narratives around artificial intelligence. On one side, we hear about existential dangers, misinformation, fake narratives, loss of jobs, and doomsday scenarios. On the other there is tremendous excitement and the promise of groundbreaking breakthroughs that could transform industries and solve some of humanity’s biggest challenges, along with dramatic productivity gains, automation, and agility..</p><p>There is also a growing concern about how these intelligent models behave under the influence of specific guardrails that may be manipulated by political or international interests to provide answers fitting particular narratives. While OpenAI’s Moderation Stack and DeepMind’s Ethics and Society research represent significant steps toward addressing these concerns, what I want to do here is move beyond the surface. I want to examine the deeper architectural factors contributing to these divergences and explore what must be embedded in the core design of our AI systems if we are to build a future with more dependable, positive outcomes for society and humanity.</p><p>The recent case of <strong>Grok</strong>, the AI developed by xAI and integrated into X (formerly Twitter), serves as yet another reminder. In its “Fun Mode,” Grok began outputting inappropriate and offensive content, prompting public concern and system rollbacks. This was not an isolated glitch. It reflects a broader structural issue. From Grok to legal research chatbots hallucinating court cases, we keep encountering the same pattern: we are building models that sound intelligent but lack internal moral structure and epistemic guardrails.</p><p>The real problem is not that these systems occasionally say the wrong thing. The deeper issue is that they lack a moral operating system before reaching an inference. They cannot reason about why something is right or wrong in the first place. They can predict but not justify. They can imitate coherence but not enforce it.</p><p>This is why surface-level safety fixes such as content filters, moderation policies, and feedback loops are no longer enough. We need to embed principles into the design itself. Alignment is not about post-processing what comes out; it is about shaping how the system thinks before it ever speaks.</p><h3>1 | Why Mere Output Policing Isn’t Enough</h3><p>To understand what’s missing in our current approach, we must start by examining the strategies that dominate today’s AI safety efforts. Most of them operate at the outermost layer of AI interaction. Content filters remove flagged terms. Reinforcement learning nudges models toward user-approved responses. Post-generation moderation checks for policy violations.</p><p>These techniques operate on the output, after the system has already generated it. A response can appear safe while being built on logic that is flawed, biased, or entirely fabricated.</p><p>The real challenge is not what the model says. It is how it reasons its way there. If we do not fix that layer, we are not building trustworthy systems. We are simply smoothing the surface. These systems are becoming increasingly intelligent, and if they lack a moral compass at their core, the consequences of their next leap in capability could be profoundly unpredictable.</p><h3>2 | A Practical Lens from Kant</h3><p>Having established the limitations of output-level fixes, we now turn to a more foundational question: what kind of moral reasoning should intelligent systems embody?</p><p>In my personal journey to find a moral operating model, I have explored the ideas of philosophers, scientists, and religious traditions from both East and West. Among them, I must confess, the first time I read Immanuel Kant, it felt like a light bulb went on in my quest. Kant proposed two main principles. The first is the universal moral law: act only on maxims you would will to become universal law. This is a test of generalizability. If every intelligent agent behaved in the same way, would the result still be ethical, sustainable, and fair?</p><p>The second principle is that no human being should ever be used as a means to an end. Unlike current models that merely include a rule about avoiding harm, this principle goes deeper. It guards against using any person as a stepping stone to a perceived goal. Both principles are not about emotion-based decision-making or following majority preference. They are a call for principled reasoning and logic. For AI, this means every inference chain must survive a universality test and never treat people as mere means to an end.</p><p>Kant gives us a lens that works well not only for humans but also for the kinds of decisions we are now asking intelligent systems to make on our behalf. His philosophy is especially helpful when designing consistent, auditable logic within intelligent models.</p><p>However, Kant’s framework is not without criticism, especially when considered for implementation within AI systems. Critics have long pointed out that his moral theory can be too rigid, offering little room for exceptions even in high-stakes dilemmas. For example, in Kant’s view, lying is always wrong even if doing so might save a life. This sort of absolutism may be problematic in dynamic systems that must weigh competing values. Others argue that Kant’s ethics fail to adequately account for emotions, empathy, and the relational context of decision-making. From the lens of care ethics, morality is not just about universal law, but about attentiveness, responsibility, and the nature of relationships. Another challenge lies in the ambiguity of moral reasoning itself. The same action can often be described using multiple maxims. Which one should a system universalize? Kant gives us a structure, but sometimes lacks guidance for prioritizing when duties conflict.</p><p>Additionally, Kant’s human-centric focus, where moral worth is derived from rational agency, can be limiting. It raises questions about how to design systems that ethically consider non-human agents, ecosystems, or distributed intelligence. Despite these limitations, Kantian ethics provides an invaluable foundation. It brings structure to moral logic, which is crucial for system design. But for AI, we will need to blend Kant’s rigorous tests with complementary approaches: utilitarianism to evaluate impact, care ethics to add relational awareness, and virtue ethics to shape the system’s internal character.</p><p>In practice, AI systems will need blended ethical scaffolding. What they all share is the core requirement for reasoning that can be tested, audited, and defended.</p><h3>3 | Embedding Ethical Reasoning: Five Concrete Mechanisms</h3><p>With philosophical grounding in place, the next step is operationalizing these ethics. If the goal is to design AI to reason with moral integrity, we must embed structure, not just impose filters. Here are five practical mechanisms that bring moral principles into system design:</p><ul><li><strong>Constraint injection</strong> embeds rules such as “never treat a person purely as a means” into the inference layer, vetoing any internal logic that violates foundational principles.</li><li><strong>Multi-agent reflection loops</strong> create internal pressure. One model generates, another critiques, and a third refines. This mirrors human reasoning through disagreement and challenge.</li><li><strong>Fallacy-aware pattern matching</strong> gives the system a cognitive library of known reasoning traps, allowing it to reject outputs based on flawed logic.</li><li><strong>Epistemic profiles</strong> ensure every answer includes a confidence score, a list of assumptions, and whether each point is known, inferred, or unverifiable.</li><li><strong>Impact simulators</strong> evaluate the downstream effects of an answer. Before surfacing a result, the system asks, “What if everyone followed this advice? Would the world still function?”</li></ul><p>These are more than features. They are the beginnings of a moral operating system.</p><h3>4 | Balancing Integrity with Performance</h3><p>Having discussed possible mechanisms, it’s essential to confront the trade-offs. There is no denying that adding ethical scaffolding increases system complexity. Guardrails can reduce speed. Universality constraints may limit personalization. Multi-agent validation adds compute cost.</p><p>But alignment is not free. It never was. The cost of moral failure at scale is higher than any latency spike. Compute efficiency can be optimized. These trade-offs must be built into design discussions now, not after flawed systems are deployed at scale.</p><p>Real-world failures underline this point. In 2023, two New York lawyers were sanctioned for submitting fabricated case citations in <em>Mata v. Avianca</em>, all generated by ChatGPT. The system produced plausible-sounding legal reference cases that simply did not exist (Reuters). Since then, judges across the U.S. have documented over 95 hallucinated citations in legal proceedings. In one case, Morgan &amp; Morgan submitted eight fictitious citations and was fined (Washington Post).</p><p>These are not just mistakes. They are warnings that we are deploying systems without moral or epistemic grounding.</p><h3>5 | A Layered Architecture for Morally Aligned AI</h3><p>All of this leads to one logical next step: architecting systems with moral reasoning built in. To move from principle to practice, we need systems whose architecture supports ethical reasoning. Below is a conceptual framework to follow and refine. This architecture includes six layers: from data validation and fact checking, to Kant’s universality principle and principle of not using people as a means to an end, to fallacy detection, and finally human oversight.</p><p><strong>Visual: Layered Architecture of a Moral AI System</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_xYiQXqQLSOr-Ek9" /></figure><p>This model is not proposed just for safety reasons. It is meant to be a framework for reasoning, reliability, and to prevent the moral collapse of AI systems. Each layer enforces a different type of trust and responsibility in the system’s outputs.</p><h3>6 | Conclusion: From Simulation to Justification</h3><p>The future of AI depends not just on how well systems simulate intelligence. It depends on whether they can justify their reasoning. We are no longer just generating content. We are mediating power, shaping decisions, and influencing how people see the world.</p><p>Surface alignment is not enough. If a model’s conclusions cannot survive universal scrutiny or logical audit, its fluency is irrelevant. We need systems that do not just avoid harm but that understand why harm should be avoided in the first place.</p><p>This is not about making AI human. It is about making it structurally principled, logically coherent, and morally defensible. We are not just designing tools anymore. We are setting the terms for future judgment, and it’s time to act like it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3030b326bbfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Cells to Circuits: How Thermodynamics Shapes Life, Intelligence, and Artificial Systems]]></title>
            <link>https://medium.com/@bdcktqmp/from-cells-to-circuits-how-thermodynamics-shapes-life-intelligence-and-artificial-systems-dc125641e125?source=rss-b917d4a1a759------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc125641e125</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[science]]></category>
            <dc:creator><![CDATA[Leyla Mousavi]]></dc:creator>
            <pubDate>Mon, 09 Jun 2025 00:27:16 GMT</pubDate>
            <atom:updated>2025-06-09T01:06:49.130Z</atom:updated>
            <content:encoded><![CDATA[<p>How Thermodynamics Shapes Complexity, Evolution, and the Future of Entropy, Life, and the Engine of Adaptation</p><p>We often hear that the Second Law of Thermodynamics, the principle that the total entropy of a closed system always increases, means everything breaks down eventually. At first glance, that sounds like it contradicts life itself. After all, life is complex, organized, and constantly building.</p><p>But the more you study it, the more obvious it becomes: life doesn’t defy the Second Law, it emerges because of it.</p><p>Living systems exist within open environments that constantly bring in energy like sunlight, chemical fuel, heat. Life uses that energy to build temporary order (cells, organisms, ecosystems), and in the process, it releases waste and heat, increasing entropy in the surrounding environment. It’s not a loophole. It’s how the law works.</p><p>Life is the universe’s way of burning fuel more creatively.</p><p>Efficiency and the Evolutionary Advantage</p><p>The story doesn’t stop with life simply using energy. What makes life interesting is that it learns to use it better.</p><p>Evolution favors systems that can extract more value from each unit of energy. Whether it’s an enzyme that speeds up a reaction, a lung that pulls more oxygen from the air, or a bird that conserves heat through better feathers, these are all about optimizing how energy is used.</p><p>Evolution refines life to burn fuel more efficiently.</p><p>But efficiency is only part of the equation. A system that is highly optimized but rigid will collapse the moment the environment shifts. That’s why life also evolved something else: adaptability.</p><p>Adaptability Is Entropy Management Over Time</p><p>The most resilient systems are not just efficient, they’re flexible. They can respond to new stressors, reconfigure their internal structure, find new paths to continue functioning.</p><p>An adaptable system can preserve its ability to process energy and information despite uncertainty. It can reorganize, learn, and shift. That’s true whether we’re talking about ecosystems, organisms, teams, or entire civilizations.</p><p>Adaptability is what allows a system to keep producing order while respecting the Second Law, even as conditions change.</p><p>This is not just a biological idea. It’s a principle we can apply to any complex system, including technology.</p><p>Artificial Intelligence: The Next Layer of Complexity</p><p>AI systems are becoming powerful tools for solving problems and processing information. But under the hood, they’re still energy-driven machines. They consume electricity, run on heat-producing hardware, and use massive computing cycles to generate structure, whether it’s text, predictions, or decisions.</p><p>AI is also an entropy engine. It produces cognitive output by consuming energy and increasing environmental disorder.</p><p>The AI systems that are most useful today are often task-specific, highly tuned, but narrow. But as we build more general, adaptive systems, models that can respond across domains, retrain themselves, collaborate with other agents, we’re seeing the same evolutionary dynamics at work.</p><p>AI, like life, needs to balance efficiency and adaptability. The future won’t belong to the most specialized systems. It will belong to the ones that can shift, learn, and evolve, just like organisms do.</p><p>If life is structured entropy production, then AI is structured cognitive entropy production, another layer on the same thermodynamic foundation.</p><p>Final Reflection</p><p>Stepping back, the pattern is clear. Life, intelligence, and now AI aren’t exceptions to entropy, they’re expressions of it. These systems exist to transform energy into useful structure, even if temporarily, while increasing entropy overall.</p><p>The ones that last are not the most powerful or efficient. They are the ones that can adapt, persist, and continue transforming energy as their environment evolves. That’s true for cells. That’s true for ecosystems and it’s true for every intelligent system we’re building today.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc125641e125" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>