포탈의 줄거리는 GLaDOS의 오디오 메시지나 "공지"를 통해 플레이어에게 드러나며, 후반부 레벨에서 발견되는 방 안의 시각적 요소들로 구성되어 있습니다. 《포탈 2의 마지막 시간들》에 따르면, 이야기는 "2010년 어느 시점"으로 설정되어 있으며, 이는 아퍼처 사이언스가 버려진 지 12년 후입니다.
게임은 첼이 동면 침대에서 깨어나 GLaDOS라는 인공지능의 지시와 경고를 듣는 것으로 시작됩니다. 첼은 게임의 메커니즘을 순차적으로 소개하는 독특한 시험실에 들어갑니다. GLaDOS의 공지는 첼에게 지침 역할을 하며 플레이어가 게임을 진행하는 데 도움을 주지만, 동시에 분위기를 조성하고 AI를 인격화합니다. 첼은 모든 시험실을 완료하면 케이크를 보상으로 약속받습니다.
첼은 GLaDOS와의 유일한 상호작용으로 비어 있는 강화 센터를 지나갑니다. 플레이어가 완료에 가까워질수록 GLaDOS의 동기와 행동은 더욱 음산해집니다. 그녀는 격려하는 듯 보이지만, GLaDOS의 행동과 말은 시험 대상자의 안전과 복지에 대한 무관심과 불성실함을 암시합니다. 첼이 진행함에 따라 시험실은 점점 더 위험해지며, 군사 안드로이드를 위해 설계된 실사격 코스와 유해한 액체로 가득 찬 방들이 포함됩니다. 또 다른 방에서는 GLaDOS가 첼이 시험을 완료하는 데 도움을 주는 가중 동반자 큐브의 중요성을 언급합니다. 그러나 GLaDOS는 첼이 계속 진행하기 전에 "비상 지능 소각로"에서 그것을 안락사해야 한다고 선언합니다. 이후 몇몇 방에는 어린아이 같은 목소리로 첼을 겨냥해 발사하는 자동 포탑이 있으며, 파괴되거나 비활성화된 후에는 그녀에게 동정심을 보입니다.
첼이 마지막 시험실을 완료한 후, GLaDOS는 첼을 죽이기 위해 소각로로 유도합니다. 첼은 포탈 건으로 탈출하여 강화 센터의 유지 보수 구역으로 향합니다. GLaDOS는 당황하며 첼을 죽이려는 것이 시험의 일환이었다고 주장합니다. GLaDOS는 첼에게 "파티 에스코트 제출 자세"를 취하라고 요청하며, 첼이 보상을 받을 수 있도록 "파티 동료"가 그녀를 데려가게 하려 하지만, 첼은 계속해서 탈출합니다. 이 구간에서 GLaDOS는 첼과 대화하며 AI가 센터의 다른 모든 사람을 죽였다는 것이 분명해집니다. 첼은 유지 보수 구역과 시험실 뒤의 비어 있는 사무실 공간을 지나가며, 때때로 올바른 방향을 가리키는 그래피티 메시지를 따릅니다. 이러한 비하인드 스테이지는 극도로 황폐한 상태로, 깨끗한 시험실과 극명한 대조를 이룹니다. 그래피티에는 "케이크는 거짓말이다"와 에밀리 디킨슨의 시 "전차", 헨리 워즈워스 롱펠로의 "수확자와 꽃들", 에밀리 브론테의 "나의 영혼은 겁쟁이가 아니다"의 패러디가 포함되어 있으며, 동반자 큐브의 죽음을 언급하고 애도합니다.
GLaDOS는 첼이 유지 보수 구역으로 더 깊이 들어갈수록 신체적 해를 가하겠다는 위협과 잘못된 발언으로 첼을 만류하려 합니다. 첼은 GLaDOS의 하드웨어가 매달려 있는 큰 방에 도달합니다. GLaDOS는 계속해서 첼을 위협하지만, 대화 중 GLaDOS에서 구체가 떨어지고 첼은 그것을 소각로에 떨어뜨립니다. GLaDOS는 첼이 도덕 핵심 또는 양심을 파괴했다고 밝혀냅니다. 이는 아퍼처 사이언스 직원들이 AI가 강화 센터를 신경독 가스로 가득 채운 후 설치한 여러 "개성 핵심" 중 하나입니다. 그것이 제거되자, 그녀는 다시 방출 장치에 접근할 수 있게 됩니다. 첼이 GLaDOS의 개성 핵심을 더 제거하고 소각하는 동안 6분 카운트다운이 시작되며, GLaDOS는 조롱과 유치한 모욕으로 그녀를 단념시키고, 로켓을 발사하여 물리적으로 위협합니다. 첼이 마지막 개성 핵심을 파괴한 후, 고장으로 방이 찢어지고 모든 것이 표면으로 이동합니다. 첼은 GLaDOS의 잔해 속에서 시설의 문 밖에 누워 있는 모습이 보입니다. 《포탈 2》의 발표 이후, 결말은 후속 업데이트에서 확장되었습니다. 이 회고적 연속성에서 첼은 로봇 목소리로 말하는 보이지 않는 존재에 의해 현장에서 끌려가며, "파티 에스코트 제출 자세"를 취해 준 것에 대해 감사받습니다.
마지막 장면은 시설의 내부를 빠르게 줌인한 후, 블랙 포레스트 케이크와 가중 동반자 큐브가 보이며, 수십 개의 비활성 개성 핵심이 담긴 선반이 혼합되어 있습니다. 개성 핵심들이 점차 불이 켜지기 시작하고, 로봇 팔이 내려와 케이크의 촛불을 끄며 방이 어두워집니다. 크레딧이 올라가는 동안 GLaDOS는 결론 보고서를 전달합니다: 실험이 대성공이었다고 선언하는 "Still Alive"라는 노래로, GLaDOS가 여전히 살아있고 그녀의 "행복한" 핵심이 비활성화되지 않았음을 플레이어에게 알립니다.
Portal's plot is revealed to the player via audio messages or "announcements" from GLaDOS and visual elements inside rooms found in later levels. According to The Final Hours of Portal 2, the year is established to be "somewhere in 2010"—twelve years after Aperture Science has been abandoned.
The game begins with Chell waking up from a stasis bed and hearing instructions and warnings from GLaDOS, an artificial intelligence, about upcoming tests. Chell enters into distinct chambers that introduce players to the game's mechanics, sequentially. GLaDOS's announcements serve as instructions to Chell and help the player progress through the game, but also develops the atmosphere and characterizes the AI as a person. Chell is promised cake as her reward if she completes all test chambers.
Chell proceeds through the empty Enrichment Center, with GLaDOS as her only interaction. As the player nears completion, GLaDOS's motives and behavior turn more sinister; although she is designed to appear encouraging, GLaDOS's actions and speech suggest insincerity and callous disregard for the safety and well-being of the test subjects. The test chambers become increasingly dangerous as Chell proceeds, tests including a live-fire course designed for military androids, as well as some chambers flooded with a hazardous liquid. In another chamber, GLaDOS notes the importance of the Weighted Companion Cube, a waist-high crate with a single large pink heart on each face, for helping Chell to complete the test. However, GLaDOS declares it must be euthanized in an "emergency intelligence incinerator" before Chell can continue. Some later chambers include automated turrets with childlike voices (also voiced by McLain) that fire at Chell, only to sympathize with her after being destroyed or disabled.
After Chell completes the final test chamber, GLaDOS maneuvers Chell into an incinerator in an attempt to kill her. Chell escapes with the portal gun and makes her way through the maintenance areas within the Enrichment Center. GLaDOS panics and insists that she was pretending to kill Chell as part of testing. GLaDOS then asks Chell to assume the "party escort submission position", lying face-first on the ground, so that a "party associate" can take her to her reward, but Chell continues her escape. In this section, GLaDOS communes with Chell as it becomes clear the AI had killed everyone else in the center. Chell makes her way through the maintenance areas and empty office spaces behind the chambers, sometimes following graffiti messages which point in the right direction. These backstage areas, which are in an extremely dilapidated state, stand in stark contrast to the pristine test chambers. The graffiti includes statements such as "the cake is a lie", and pastiches of Emily Dickinson's poem "The Chariot", Henry Wadsworth Longfellow's "The Reaper and the Flowers", and Emily Brontë's "No Coward Soul Is Mine", referring to and mourning the death of the Companion Cube.
GLaDOS attempts to dissuade Chell with threats of physical harm and misleading statements as Chell makes her way deeper into the maintenance areas. Chell reaches a large chamber where GLaDOS's hardware hangs overhead. GLaDOS continues to threaten Chell, but during the exchange, a sphere falls off of GLaDOS and Chell drops it in an incinerator. GLaDOS reveals that Chell has just destroyed the morality core or her conscience, one of the multiple "personality cores" that Aperture Science employees installed after the AI flooded the enrichment center with neurotoxin gas. With it removed, she can access its emitters again. A six-minute countdown starts as Chell dislodges and incinerates more of GLaDOS' personality cores, while GLaDOS discourages her both verbally, with taunts and juvenile insults, and physically by firing rockets at her. After Chell destroys the last personality core, a malfunction tears the room apart and transports everything to the surface. Chell is then seen lying outside the facility's gates amid the remains of GLaDOS. Following the announcement of Portal 2, the ending was expanded in a later update. In this retroactive continuity, Chell is dragged away from the scene by an unseen entity speaking in a robotic voice, thanking her for assuming the "party escort submission position".
The final scene, after a long and speedy zoom through the bowels of the facility, shows a Black Forest cake, and the Weighted Companion Cube, surrounded by a mix of shelves containing dozens of apparently inactive personality cores. The cores begin to light up, before a robotic arm descends and extinguishes the candle on the cake, causing the room to blackout. As the credits roll, GLaDOS delivers a concluding report: the song "Still Alive", which declares the experiment to be a huge success, as well as serving to indicate to the player that GLaDOS is still alive, that her "happy" core was not disabled.